main.py

Go to the documentation of this file.
00001 #!/usr/bin/python
00002 
00003 """
00004 \bug - play, drag and drop it, play another -> broken highlight
00005 \bug - ?'s in place of extended ascii chars. Pango Warnings are off to ignore this.
00006 \todo - make a deb or something for installing
00007 \todo - fix the database design (rowid) (prob need autoincrement)
00008 """
00009 
00010 from __future__ import with_statement
00011 
00012 import gtk,gtk.glade,gobject,pango
00013 import pickle,warnings
00014 
00015 from plai.trayicon import TrayIcon
00016 from plai.player import Player
00017 from plai.utility import ReportError
00018 from plai import config         
00019 
00020 
00021 def SlowInit(player):
00022         with file(config.picklefname,'r') as f:
00023                 try:
00024                         state=pickle.load(f)
00025                         player.SetState(state)
00026                 except Exception,ex:
00027                         ReportError('Failed to restore player state',ex.args)
00028                         
00029         tray=TrayIcon(player)
00030                 
00031         return False
00032 
00033 
00034 def main():
00035         # turn off the pango warnings about invalid utf8 until I find a better solution
00036         warnings.simplefilter('ignore', pango.Warning)
00037 
00038         print 'Start'
00039         
00040         gobject.threads_init()
00041         
00042         player=Player() 
00043         
00044         gobject.idle_add(SlowInit,player)
00045         
00046         print 'Entering gtk.main'
00047         gtk.main()
00048         print 'End\n'
00049         
00050         
00051 if __name__=='__main__':
00052         main()
00053         

Generated on Mon Aug 6 21:24:19 2007 for plai by  doxygen 1.5.1