def __init__(self, parent, options): ## Holds a bool indicating if pyjama is running verbose self.verbose = options.verbose ## Holds a bool indicating if pyjama is running in debugging mode self.debug = options.debug ## Holds a bool indicating if pyjama is running in debugging extreme mode self.debug_extreme = options.debug_extreme # self.print_tracebacks = options.print_tracebacks ## Hold pyjama's current version self.version = functions.VERSION if GNOME_UI_AVAILABLE: gnome.init("Pyjama", self.version) print "PYJAMA FOUND IN %s" % functions.install_dir() ## In some cases to many windows pop up on pyjama's # startup. If you want to popup a message on startup # please wait until need_attention is False! self.need_attention = False ## Pyjama's Event class self.Events = clEvent.Events() # Create some events: self.Events.add_event("pluginloaded") self.Events.add_event("nowplaying") self.Events.add_event("alldone") self.Events.add_event("showing_album_page") self.Events.add_event("showing_artist_page") self.Events.add_event("firstrun") self.Events.add_event("error") self.Events.add_event("info") self.Events.add_event("info") self.Events.add_event("layout_changed") self.Events.add_event("populate_listmenu") self.Events.add_event("populate_playlistmenu") self.Events.add_event("scrolled_window_resized") self.Events.add_event("playlist_tooltip") self.Events.add_event("quit") self.Events.add_event("albuminfo_created") self.Events.add_event("hide_controls") self.Events.add_event("show_controls") ## Connect to some events self.Events.connect_event("pluginloaded", self.ev_plugin_loaded) self.Events.connect_event("error", self.error) self.Events.connect_event("info", self.info) self.home_fkt = self.go_home_fkt ## Pyjama's Settings class # Use for simple general settings # data will be stored in a pyjama.cfg self.settings = clSettings.settings(self) ## Pyjama's database setting class # Use this, if you need to store many # values. self.settingsdb = dbthreaded.DB_Settings(self) # self.settingsdb = clDB.DB_Settings(self) ## Database class clDB.DB self.db = dbthreaded.DB(self) # self.db = clDB.DB(self) ## Some database-dump tools self.dump_tools = download_db.dump_tools(self) ## The clWindow.gtkWIN reference self.window = parent ## The notification TrayIcon class notification.TrayIcon self.icon = notification.TrayIcon(self) ## The Audio class clGstreamer010.Player self.player = PLAYER.Player(self, sink=self.__get_audio_interface()) ## Pyjama's class for jamendo's get2 api clJamendo.Jamendo self.jamendo = clJamendo.Jamendo(self) ## The browser class clBrowserInterfacce.Browser for handling # different browser calls self.browser = clBrowserInterface.Browser(self) ## Pyjama's clLayouts.Layouts is referenced here # it is most important for anything to show up in the # main paned field self.layouts = clLayouts.Layouts(self) ## Preferences self.preferences = clPreferences.Preferences(self) if XMLRPC_AVAILABLE: self.xmlrpc = clXMLRPC.XMLRPC(self) for item in sys.argv: if item.endswith(".m3u"): if self.xmlrpc.role == "client": try: self.xmlrpc.server.test("test123") except Exception, inst: print ("Could not connect to server: %s" % inst) break