def configTest(): print "config test set" config.load("data/test.conf") try: assert config.name == "name", "Was not able to load name from config file" assert config.coherence_conf == "coherence_path", "Was not able to load coherence config path from config file" assert config.temp_folder == "temp_folder", "Was not able to load temp folder path from config file" assert config.device_type == "phone", "Was not able to load device type from config file" assert len(config.share_folders) == 2, "Was not able to load all shared folders from config file" assert config.share_folders[0] == "folder_path1", "Was not able to load first folder path from config file" assert config.share_folders[1] == "folder_path2", "Was not able to load second folder path from config file" except AssertionError as err: print "ERROR:",err
from Module import DbusModule, UpnpModule, WorkerModule from BackendUpnp import BackendUpnp from Config import Config,config def close(signal=None,frame=None): print "close application" event_handler.close() event_handler.join() upnp.close() print "application closed" if __name__ == '__main__': #init config file print "load global config file" if len(sys.argv) < 2: config.load("../conf/mymeego.conf") else: config.load(sys.argv[1]) #init mainloop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) # get session bus bus = dbus.SessionBus() mainloop = gobject.MainLoop() event_handler = EventHandler(mainloop) # init upnp ######## configfile = config.coherence_conf if len(configfile) <= 0:
from Config import Config, config def close(signal=None, frame=None): print "close application" event_handler.close() event_handler.join() upnp.close() print "application closed" if __name__ == '__main__': #init config file print "load global config file" if len(sys.argv) < 2: config.load("../conf/mymeego.conf") else: config.load(sys.argv[1]) #init mainloop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) # get session bus bus = dbus.SessionBus() mainloop = gobject.MainLoop() event_handler = EventHandler(mainloop) # init upnp ######## configfile = config.coherence_conf if len(configfile) <= 0: