- Added debug flag on GlossMgr
This commit is contained in:
parent
77c7802f90
commit
64833f2386
|
@ -13,6 +13,7 @@ class GlossMgr:
|
|||
self.menus = []
|
||||
self.menuHistory = [] #A list that contains menus in the order that they've been viewed
|
||||
self.currentMenu = None
|
||||
self.debug = False #Debug flag
|
||||
self.uiMsg = message(stage)
|
||||
|
||||
self.themeMgr = ThemeMgr(self)
|
||||
|
|
Binary file not shown.
BIN
Spinner.pyc
BIN
Spinner.pyc
Binary file not shown.
14
gloss.py
14
gloss.py
|
@ -26,17 +26,17 @@ from GlossMgr import GlossMgr
|
|||
from myth.MythMySQL import mythDB
|
||||
|
||||
class MainApp:
|
||||
def __init__ (self):
|
||||
def __init__ (self, args):
|
||||
gtk.gdk.threads_init()
|
||||
clutter.threads_init()
|
||||
|
||||
self.args = args
|
||||
|
||||
self.stage = clutter.stage_get_default()
|
||||
self.stage.set_color(clutter.color_parse('Black'))
|
||||
#self.stage.set_size(800, 600)
|
||||
self.stage.set_property("fullscreen", True)
|
||||
self.stage.connect('button-press-event', self.on_button_press_event)
|
||||
self.stage.show_all()
|
||||
#clutter.main()
|
||||
|
||||
#hide the cursor
|
||||
self.stage.hide_cursor()
|
||||
|
@ -52,6 +52,12 @@ class MainApp:
|
|||
def loadGloss(self):
|
||||
|
||||
self.glossMgr = GlossMgr(self.stage)
|
||||
|
||||
#loop through the args
|
||||
for arg in self.args:
|
||||
if arg == "--debug":
|
||||
print "Using debug mode"
|
||||
self.glossMgr.debug = True
|
||||
|
||||
#Update splash status msg
|
||||
self.splashScreen.set_msg("Creating menus")
|
||||
|
@ -98,7 +104,7 @@ class MainApp:
|
|||
clutter.main()
|
||||
|
||||
def main (args):
|
||||
app = MainApp()
|
||||
app = MainApp(args)
|
||||
#app.loadGloss()
|
||||
app.run()
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class channel:
|
|||
self.atsc_minor_chan = mythObject[25]
|
||||
self.last_record = mythObject[26]
|
||||
except IndexError, e:
|
||||
print "Found difference in DB structure. Attempting to continue."
|
||||
print "TV_Player: Found difference in DB structure for channels. Attempting to continue."
|
||||
|
||||
class show:
|
||||
|
||||
|
@ -107,4 +107,4 @@ class show:
|
|||
self.first = mythObject[27]
|
||||
self.last = mythObject[28]
|
||||
except IndexError, e:
|
||||
print "Found difference in DB structure. Attempting to continue."
|
||||
print "TV_Player: Found difference in DB structure for show. Attempting to continue."
|
|
@ -35,6 +35,12 @@ class Module():
|
|||
foldersPosX = 50
|
||||
foldersPosX = 50
|
||||
cover_size = int(coverViewerWidth / coverViewerColumns)
|
||||
|
||||
#Basic UI elements
|
||||
currentViewer = None
|
||||
backdrop = None
|
||||
video_details = None
|
||||
covers_background = None
|
||||
|
||||
def __init__(self, glossMgr, dbMgr):
|
||||
self.stage = glossMgr.get_stage()
|
||||
|
@ -53,6 +59,8 @@ class Module():
|
|||
#This block can be moved to begin() but causes a performance hit when loading the module *shrug*
|
||||
#All it does is load the initial folders into the viewers
|
||||
self.baseDir = dbMgr.get_setting("VideoStartupDir")
|
||||
if self.glossMgr.debug: print "VideoPlayer: Base directory=" + str(self.baseDir)
|
||||
|
||||
self.cwd = self.baseDir
|
||||
self.folder_level = 0
|
||||
self.base_folder_menu = folderMenu(glossMgr, self.coverViewerRows, self.folders_cover_size)
|
||||
|
@ -104,10 +112,10 @@ class Module():
|
|||
try:
|
||||
new_file_list = os.listdir(dirPath)
|
||||
except os.error, (errno, errstr):
|
||||
self.glossMgr.display_msg("File Error", "Could not load Slideshow directory")
|
||||
self.glossMgr.display_msg("VideoPlayer File Error", "Could not load Video directory")
|
||||
return
|
||||
|
||||
#Images and Directories
|
||||
#Videos and Directories
|
||||
for dir_entry in new_file_list:
|
||||
tempPath = dirPath + "/" + dir_entry
|
||||
if os.path.isdir(tempPath) and not ( dir_entry[0] == "."):
|
||||
|
@ -117,13 +125,13 @@ class Module():
|
|||
|
||||
def loadDir(self, dirPath, cover_viewer):
|
||||
if not os.path.isdir(dirPath):
|
||||
print "ERROR: Invalid path"
|
||||
print "ERROR VideoPlayer: Invalid video path"
|
||||
return None
|
||||
|
||||
final_file_list = []
|
||||
new_file_list = os.listdir(dirPath)
|
||||
|
||||
#Images and Directories
|
||||
#Videos and Directories
|
||||
for dir_entry in new_file_list:
|
||||
if os.path.isdir(dirPath + "/" + dir_entry) and not ( dir_entry[0] == "."):
|
||||
cover_viewer.add_folder(dir_entry)
|
||||
|
@ -148,7 +156,9 @@ class Module():
|
|||
sqlLength = int(len(sql) - 2)
|
||||
sql = sql[:sqlLength]
|
||||
sql = sql + ")"
|
||||
#print sql
|
||||
|
||||
if self.glossMgr.debug: print "Video SQL: " + sql
|
||||
|
||||
results = self.dbMgr.run_sql(sql)
|
||||
|
||||
#Check for null return
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue