Moved execution_path() to Configuration.py.
This commit is contained in:
parent
3994d3bb94
commit
094f176c5d
|
@ -25,6 +25,7 @@ Handles HUD configuration files.
|
||||||
# Standard Library modules
|
# Standard Library modules
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import inspect
|
||||||
import string
|
import string
|
||||||
import traceback
|
import traceback
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -582,6 +583,10 @@ class Config:
|
||||||
sg.append(c.supported_games[game].game_name)
|
sg.append(c.supported_games[game].game_name)
|
||||||
return sg
|
return sg
|
||||||
|
|
||||||
|
def execution_path(self, filename):
|
||||||
|
"""Join the fpdb path to filename."""
|
||||||
|
return os.path.join(os.path.dirname(inspect.getfile(sys._getframe(1))), filename)
|
||||||
|
|
||||||
if __name__== "__main__":
|
if __name__== "__main__":
|
||||||
c = Config()
|
c = Config()
|
||||||
|
|
||||||
|
@ -638,3 +643,5 @@ if __name__== "__main__":
|
||||||
|
|
||||||
for game in c.get_supported_games():
|
for game in c.get_supported_games():
|
||||||
print c.get_game_parameters(game)
|
print c.get_game_parameters(game)
|
||||||
|
|
||||||
|
print "start up path = ", c.execution_path("")
|
|
@ -24,7 +24,6 @@ import gtk
|
||||||
import gobject
|
import gobject
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import inspect
|
|
||||||
import time
|
import time
|
||||||
import fpdb_import
|
import fpdb_import
|
||||||
|
|
||||||
|
@ -107,10 +106,6 @@ class GuiAutoImport (threading.Thread):
|
||||||
print "GuiAutoImport.import_dir done"
|
print "GuiAutoImport.import_dir done"
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def execution_path(self, filename):
|
|
||||||
"""Join the fpdb path to filename."""
|
|
||||||
return os.path.join(os.path.dirname(inspect.getfile(sys._getframe(1))), filename)
|
|
||||||
|
|
||||||
def startClicked(self, widget, data):
|
def startClicked(self, widget, data):
|
||||||
"""runs when user clicks start on auto import tab"""
|
"""runs when user clicks start on auto import tab"""
|
||||||
|
|
||||||
|
@ -132,7 +127,7 @@ class GuiAutoImport (threading.Thread):
|
||||||
self.pipe_to_hud = subprocess.Popen(command, bufsize = bs, stdin = subprocess.PIPE,
|
self.pipe_to_hud = subprocess.Popen(command, bufsize = bs, stdin = subprocess.PIPE,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
else:
|
else:
|
||||||
command = self.execution_path('HUD_main.py')
|
command = self.config.execution_path('HUD_main.py')
|
||||||
bs = 1
|
bs = 1
|
||||||
self.pipe_to_hud = subprocess.Popen((command, self.database), bufsize = bs, stdin = subprocess.PIPE,
|
self.pipe_to_hud = subprocess.Popen((command, self.database), bufsize = bs, stdin = subprocess.PIPE,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user