def home(): category_list = [get_category("Takeout")] locsearch = SearchForm() if request.method == "POST": try: src = request.form["src"] dest = request.form["dest"] result_cat = "테이크아웃" category = get_category("Takeout") lists = category["items"] locsearch = SearchForm() print(src, dest) return render_with_opt('listing.html', '/listing/', result_cat=result_cat, lists=lists, locsearch=locsearch, src=src, dest=dest) except: return render_with_opt("home.html", '/home/', category_list=category_list, locsearch=locsearch) return render_with_opt("home.html", '/home/', category_list=category_list, locsearch=locsearch)
def main(): """ the main method of emesene """ extension.category_register("session", dummy.Session, single_instance=True) extension.category_register("option provider", None, interfaces=interfaces.IOptionProvider) extension.get_category("option provider").multi_extension = True extension.get_category("option provider").activate(ExtensionDefault) options = PluggableOptionParser(args=emesene_args) options.read_options() main_method = extension.get_default("main") main_method(Controller)
def main(): """ the main method of emesene """ extension.category_register('session', msn.Session, single_instance=True) extension.category_register('option provider', None, interfaces=interfaces.IOptionProvider) extension.get_category('option provider').multi_extension = True extension.get_category('option provider').activate(ExtensionDefault) options = PluggableOptionParser(argv) options.read_options() main_method = extension.get_default('main') main_method(Controller)
def main(): """ the main method of emesene """ extension.category_register('session', dummy.Session, single_instance=True) extension.category_register('option provider', None, interfaces=interfaces.IOptionProvider) extension.get_category('option provider').multi_extension = True extension.get_category('option provider').activate(ExtensionDefault) options = PluggableOptionParser(argv) options.read_options() main_method = extension.get_default('main') main_method(Controller)
def main(): """ the main method of emesene """ #extension.category_register('session', dummy.Session, single_instance=True) extension.category_register('option provider', None, interfaces=interfaces.IOptionProvider) extension.register('quit', sys.exit) extension.get_category('option provider').multi_extension = True extension.get_category('option provider').activate(optionprovider.ExtensionDefault) options = optionprovider.PluggableOptionParser(args=emesene_args) options.read_options() main_method = extension.get_default('main') main_method(Controller)
def set_default(self, option, opt, value, parser): """set default extensions""" for couple in value.split(";"): category_name, ext_name = [strng.strip() for strng in couple.split(":", 2)] if not extension.get_category(category_name).set_default_by_name(ext_name): print 'Error setting extension "%s" default session to "%s"' % (category_name, ext_name)
def _setup(self): """register core extensions""" extension.category_register("session", dummy.Session, single_instance=True) if xmpp is not None: extension.register("session", xmpp.Session) extension.register("session", dummy.Session) if webqq is not None: extension.register("session", webqq.Session) extension.register("session", dummy.Session) if papylib is not None: extension.register("session", papylib.Session) extension.set_default("session", papylib.Session) else: extension.set_default("session", dummy.Session) # external API stuff self.dbus_ext = extension.get_and_instantiate("external api") self.network_checker = extension.get_and_instantiate("network checker") self.unity_launcher = extension.get_and_instantiate("unity launcher") extension.category_register("sound", e3.common.Sounds.SoundPlayer, None, True) extension.category_register("notification", e3.common.notification.Notification) extension.category_register("history exporter", e3.Logger.save_logs_as_txt) extension.register("history exporter", e3.Logger.save_logs_as_xml) if self.config.session is None: default_id = extension.get_category("session").default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id("session", default_id)
def __init__(self, args): self.parser = optparse.OptionParser(conflict_handler="resolve") self.args = args custom_options = extension.get_category('option provider').use()()\ .option_register().get_result() for opt in custom_options.values(): self.parser.add_option(opt)
def _setup(self): """register core extensions""" extension.category_register("session", msn.Session, single_instance=True) extension.register("session", jabber.Session) extension.register("session", dummy.Session) extension.register("session", msn.Session) if papylib is not None: extension.register("session", papylib.Session) extension.set_default("session", papylib.Session) else: extension.set_default("session", msn.Session) extension.category_register("sound", e3.common.play_sound.play) extension.category_register("notification", e3.common.notification.Notification) extension.category_register("history exporter", e3.Logger.save_logs_as_txt) if self.config.session is None: default_id = extension.get_category("session").default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id("session", default_id) get_pluginmanager().scan_directory("plugins")
def set_default(self, option, opt, value, parser): for couple in value.split(';'): (category_name, ext_name) = map(string.strip, couple.split(':', 2)) if not extension.get_category(category_name)\ .set_default_by_name(ext_name): print 'Error setting extension "%s" default session to "%s"'\ % (category_name, ext_name)
def _setup(self): '''register core extensions''' extension.category_register('session', msn.Session, single_instance=True) extension.register('session', jabber.Session) extension.register('session', dummy.Session) extension.register('session', msn.Session) if papylib is not None: extension.register('session', papylib.Session) extension.set_default('session', papylib.Session) else: extension.set_default('session', msn.Session) extension.category_register('sound', e3.common.play_sound.play) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.save_logs_as_txt) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id) get_pluginmanager().scan_directory('plugins')
def listing(): src = "" dest = "" result_cat = "테이크아웃" category = get_category("Takeout") lists = category["items"] locsearch = SearchForm() if request.method == "POST": try: src = request.form["src"] dest = request.form["dest"] bike = playFinder(src, dest, bikeCol) playList = bike.finder(collection) lists = [] col = list(collection.find({})) pl = playList[0:6] for i in pl: lists.append(col[i]['items']) print('##################################' + lists) except: return render_with_opt('listing.html', '/listing/', result_cat=result_cat, lists=lists, locsearch=locsearch, src=src, dest=dest) return render_with_opt('listing.html', '/listing/', result_cat=result_cat, lists=lists, locsearch=locsearch, src=src, dest=dest)
def _setup(self): '''register core extensions''' extension.category_register('session', dummy.Session, single_instance=True) #extension.category_register('session', msn.Session, # single_instance=True) extension.register('session', jabber.Session) extension.register('session', dummy.Session) #extension.register('session', msn.Session) if papylib is not None: extension.register('session', papylib.Session) extension.set_default('session', papylib.Session) else: extension.set_default('session', dummy.Session) #DBus extension stuffs extension.category_register('external api', DBusController) extension.set_default('external api', DBusController) self.dbus_ext = extension.get_and_instantiate('external api') extension.category_register('sound', e3.common.play_sound.play) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.save_logs_as_txt) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id)
def _setup(self): '''register core extensions''' extension.category_register('session', msn.Session, single_instance=True) extension.register('session', jabber.Session) extension.register('session', dummy.Session) if papylib is not None: extension.register('session', papylib.Session) extension.set_default('session', papylib.Session) extension.category_register('sound', e3.common.play_sound.play) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.save_logs_as_txt) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id) get_pluginmanager().scan_directory('plugins')
def _setup(self): """register core extensions""" extension.category_register("session", dummy.Session, single_instance=True) # extension.category_register('session', msn.Session, # single_instance=True) if jabber is not None: extension.register("session", jabber.Session) extension.register("session", dummy.Session) # extension.register('session', msn.Session) if papylib is not None: extension.register("session", papylib.Session) extension.set_default("session", papylib.Session) else: extension.set_default("session", dummy.Session) # DBus extension stuffs if DBusController is not None: extension.category_register("external api", DBusController) extension.set_default("external api", DBusController) self.dbus_ext = extension.get_and_instantiate("external api") else: self.dbus_ext = None extension.category_register("sound", e3.common.play_sound.play) extension.category_register("notification", e3.common.notification.Notification) extension.category_register("history exporter", e3.Logger.save_logs_as_txt) if self.config.session is None: default_id = extension.get_category("session").default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id("session", default_id)
def config(self, session): '''config the plugin''' category = extension.get_category(CATEGORY) player = category.get_instance() if player != None: player.preferences() self.redraw_main_window() return True
def set_default(self, option, opt, value, parser): '''set default extensions''' for couple in value.split(';'): category_name, ext_name = map(string.strip, couple.split(':', 2)) if not extension.get_category(category_name)\ .set_default_by_name(ext_name): print 'Error setting extension "%s" default session to "%s"'\ % (category_name, ext_name)
def set_default(self, option, opt, value, parser): '''set default extensions''' for couple in value.split(';'): category_name, ext_name = [strng.strip()\ for strng in couple.split(':', 2)] if not extension.get_category(category_name)\ .set_default_by_name(ext_name): print 'Error setting extension "%s" default session to "%s"'\ % (category_name, ext_name)
def import_and_register(category_name, cls): try: imported_cls = __import__('gui.common.'+cls) if extension.get_category(category_name) is None: extension.category_register(category_name, eval(cls+'.'+cls)) else: extension.register(category_name, eval(cls+'.'+cls)) return imported_cls except ImportError: return None
def import_and_register(category_name, cls): try: imported_cls = __import__('gui.common.' + cls) if extension.get_category(category_name) is None: extension.category_register(category_name, eval(cls + '.' + cls)) else: extension.register(category_name, eval(cls + '.' + cls)) return imported_cls except ImportError: return None
def _setup(self): '''register core extensions''' extension.category_register('session', dummy.Session, single_instance=True) #extension.category_register('session', msn.Session, # single_instance=True) if jabber is not None: extension.register('session', jabber.Session) extension.register('session', dummy.Session) #extension.register('session', msn.Session) if papylib is not None: extension.register('session', papylib.Session) extension.set_default('session', papylib.Session) else: extension.set_default('session', dummy.Session) #DBus extension stuffs if DBusController is not None: extension.category_register('external api', DBusController) extension.set_default('external api', DBusController) self.dbus_ext = extension.get_and_instantiate('external api') else: self.dbus_ext = None if DBusNetworkChecker is not None: extension.category_register('network checker', DBusNetworkChecker) extension.set_default('network checker', DBusNetworkChecker) self.network_checker = extension.get_and_instantiate( 'network checker') else: self.network_checker = None if UnityLauncher is not None: extension.category_register('unity launcher', UnityLauncher) extension.set_default('unity launcher', UnityLauncher) self.unity_launcher = extension.get_and_instantiate( 'unity launcher', self.close_session) else: self.unity_launcher = None extension.category_register('sound', e3.common.Sounds.SoundPlayer, None, True) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.save_logs_as_txt) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id)
def _setup(self): '''register core extensions''' extension.category_register('session', dummy.Session, single_instance=True) if Info.EMESENE_VERSION.endswith("dev"): extension.register('session', dummy.Session) if webqq is not None: extension.register('session', webqq.Session) extension.set_default('session', webqq.Session) if xmpp is not None: extension.register('session', xmpp.Session) extension.set_default('session', xmpp.Session) if papylib is not None: extension.register('session', papylib.Session) extension.set_default('session', papylib.Session) #external API stuff self.dbus_ext = extension.get_and_instantiate('external api') self.network_checker = extension.get_and_instantiate('network checker') handler = gui.base.TrayIconHandler(self.session, gui.theme, self.close_session) unitylaunchercls = extension.get_default('unity launcher') self.unity_launcher = unitylaunchercls(handler) extension.category_register('sound', e3.common.Sounds.SoundPlayer, None, True) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.ExporterTxt) extension.register('history exporter', e3.Logger.ExporterXml) extension.register('history exporter', e3.Logger.ExporterHtml) extension.register('history exporter', e3.Logger.ExporterCsv) extension.register('history exporter', e3.Logger.ExporterJSON) # ui callbacks for plugins extension.category_register('send message callback handler', e3.common.PriorityList, single_instance=True) extension.category_register('receive message callback handler', e3.common.PriorityList, single_instance=True) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id)
def _setup(self): '''register core extensions''' #extension.category_register('session', dummy.Session, # single_instance=True) #if Info.EMESENE_VERSION.endswith("dev"): # extension.register('session', dummy.Session) #if webqq is not None: # extension.register('session', webqq.Session) # extension.set_default('session', webqq.Session) #if xmpp is not None: # extension.register('session', xmpp.Session) # extension.set_default('session', xmpp.Session) if whatsapp is not None: extension.register('session', whatsapp.Session) extension.set_default('session', whatsapp.Session) #if papylib is not None: # extension.register('session', papylib.Session) # extension.set_default('session', papylib.Session) #external API stuff self.dbus_ext = extension.get_and_instantiate('external api') self.network_checker = extension.get_and_instantiate( 'network checker') self.unity_launcher = extension.get_and_instantiate('unity launcher') extension.category_register('sound', e3.common.Sounds.SoundPlayer, None, True) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.ExporterTxt) extension.register('history exporter', e3.Logger.ExporterXml) extension.register('history exporter', e3.Logger.ExporterHtml) extension.register('history exporter', e3.Logger.ExporterCsv) extension.register('history exporter', e3.Logger.ExporterJSON) # ui callbacks for plugins extension.category_register('send message callback handler', e3.common.PriorityList, single_instance=True) extension.category_register('receive message callback handler', e3.common.PriorityList, single_instance=True) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id)
def _setup(self): '''register core extensions''' extension.category_register('session', dummy.Session, single_instance=True) #extension.category_register('session', msn.Session, # single_instance=True) if jabber is not None: extension.register('session', jabber.Session) extension.register('session', dummy.Session) #extension.register('session', msn.Session) if papylib is not None: extension.register('session', papylib.Session) extension.set_default('session', papylib.Session) else: extension.set_default('session', dummy.Session) #DBus extension stuffs if DBusController is not None: extension.category_register('external api', DBusController) extension.set_default('external api', DBusController) self.dbus_ext = extension.get_and_instantiate('external api') else: self.dbus_ext = None if DBusNetworkChecker is not None: extension.category_register('network checker', DBusNetworkChecker) extension.set_default('network checker', DBusNetworkChecker) self.network_checker = extension.get_and_instantiate( 'network checker') else: self.network_checker = None self.unity_launcher = extension.get_and_instantiate('unity launcher') extension.category_register('sound', e3.common.Sounds.SoundPlayer, None, True) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.save_logs_as_txt) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id)
def _setup(self): '''register core extensions''' extension.category_register('session', dummy.Session, single_instance=True) extension.register('session', dummy.Session) if webqq is not None: extension.register('session', webqq.Session) extension.set_default('session', webqq.Session) if xmpp is not None: extension.register('session', xmpp.Session) extension.set_default('session', xmpp.Session) if papylib is not None: extension.register('session', papylib.Session) extension.set_default('session', papylib.Session) #external API stuff self.dbus_ext = extension.get_and_instantiate('external api') self.network_checker = extension.get_and_instantiate( 'network checker') self.unity_launcher = extension.get_and_instantiate('unity launcher') extension.category_register('sound', e3.common.Sounds.SoundPlayer, None, True) extension.category_register('notification', e3.common.notification.Notification) extension.category_register('history exporter', e3.Logger.ExporterTxt) extension.register('history exporter', e3.Logger.ExporterXml) extension.register('history exporter', e3.Logger.ExporterHtml) extension.register('history exporter', e3.Logger.ExporterCsv) extension.register('history exporter', e3.Logger.ExporterJSON) if self.config.session is None: default_id = extension.get_category('session').default_id self.config.session = default_id else: default_id = self.config.session extension.set_default_by_id('session', default_id)
# fix for gstreamer --help argv = sys.argv sys.argv = [argv[0]] class SingleInstanceOption(object): '''option parser''' def option_register(self): '''register the options to parse by the command line option parser''' option = optparse.Option("-s", "--single", action="count", dest="single_instance", default=False, help="Allow only one instance of emesene") return option extension.implements('option provider')(SingleInstanceOption) extension.get_category('option provider').activate(SingleInstanceOption) class VerboseOption(object): '''option parser''' def option_register(self): '''register the options to parse by the command line option parser''' option = optparse.Option("-v", "--verbose", action="count", dest="debuglevel", default=0, help="Enable debug in console (add another -v to show debug)") return option extension.implements('option provider')(VerboseOption) extension.get_category('option provider').activate(VerboseOption) class Controller(object):
pass def option_register(self): option = optparse.Option( "-v", "--verbose", action="count", dest="debuglevel", default=0, help="Enable debug in console (add another -v to show debug)", ) return option extension.implements("option provider")(VerboseOption) extension.get_category("option provider").activate(VerboseOption) class Controller(object): """class that handle the transition between states of the windows""" def __init__(self): """class constructor""" self.window = None self.tray_icon = None self.conversations = None self.config = e3.common.Config() self.config_dir = e3.common.ConfigDir("emesene2") self.config_path = self.config_dir.join("config") self.config.load(self.config_path)
imported_cls = __import__('gui.common.' + cls) if extension.get_category(category_name) is None: extension.category_register(category_name, eval(cls + '.' + cls)) else: extension.register(category_name, eval(cls + '.' + cls)) return imported_cls except ImportError: return None #FIXME: gi init the debugger and spam the console if a package isn't found from gui.gtkui import check_gtk3 if check_gtk3(): import debugger debugger.init(debuglevel=0) if check_gtk3(): import_and_register('tray icon', 'MessagingMenuNew') if extension.get_category('tray icon') is None: import_and_register('tray icon', 'MessagingMenu') import_and_register('tray icon', 'Indicator') import_and_register('tray icon', 'TrayIcon') import_and_register('tray icon', 'NoTrayIcon') import_and_register(('notificationGUI'), 'GrowlNotification') import_and_register(('notificationGUI'), 'GNTPNotification') import_and_register(('notificationGUI'), 'PyNotification') import_and_register(('notificationGUI'), 'GtkNotification') import_and_register(('notificationImage'), 'ThemeNotificationImage') import_and_register(('notificationImage'), 'DummyNotificationImage') import_and_register('unity launcher', 'UnityLauncher')
class SingleInstanceOption(object): '''option parser''' def option_register(self): '''register the options to parse by the command line option parser''' option = optparse.Option("-s", "--single", action="count", dest="single_instance", default=False, help="Allow only one instance of emesene") return option extension.implements('option provider')(SingleInstanceOption) extension.get_category('option provider').activate(SingleInstanceOption) class VerboseOption(object): '''option parser''' def option_register(self): '''register the options to parse by the command line option parser''' option = optparse.Option( "-v", "--verbose", action="count", dest="debuglevel", default=0, help="Enable debug in console (add another -v to show debug)") return option
imported_cls = __import__('gui.common.'+cls) if extension.get_category(category_name) is None: extension.category_register(category_name, eval(cls+'.'+cls)) else: extension.register(category_name, eval(cls+'.'+cls)) return imported_cls except ImportError: return None #FIXME: gi init the debugger and spam the console if a package isn't found from gui.gtkui import check_gtk3 if check_gtk3(): import debugger debugger.init(debuglevel=0) if check_gtk3(): import_and_register('tray icon', 'MessagingMenuNew') if extension.get_category('tray icon') is None: import_and_register('tray icon', 'MessagingMenu') import_and_register('tray icon', 'Indicator') import_and_register('tray icon', 'TrayIcon') import_and_register('tray icon', 'NoTrayIcon') import_and_register(('notificationGUI'), 'GrowlNotification') import_and_register(('notificationGUI'), 'GNTPNotification') import_and_register(('notificationGUI'), 'PyNotification') import_and_register(('notificationGUI'), 'GtkNotification') import_and_register(('notificationGUI'), 'QtNotification') import_and_register(('notificationImage'), 'ThemeNotificationImage') import_and_register(('notificationImage'), 'DummyNotificationImage') import_and_register('unity launcher', 'UnityLauncher')
import gui class MinimizedOption(object): """option parser""" def option_register(self): """register the options to parse by the command line option parser""" option = optparse.Option( "-m", "--minimized", action="count", dest="minimized", default=False, help="Minimize emesene at start" ) return option extension.implements("option provider")(MinimizedOption) extension.get_category("option provider").activate(MinimizedOption) class SingleInstanceOption(object): """option parser""" def option_register(self): """register the options to parse by the command line option parser""" option = optparse.Option( "-s", "--single", action="count", dest="single_instance", default=False, help="Allow only one instance of emesene", )