def main(store=False, metadata=False, port=6601): win = Gtk.Window() # Connect to the test-server boot_base( verbosity=logging.DEBUG, protocol_machine='idle', host='localhost', port=port ) if store: boot_store() if metadata: boot_metadata() win.connect('destroy', Gtk.main_quit) try: yield win except: raise else: win.show_all() Gtk.main() finally: shutdown_application()
def do_close_application(self, window, event): window.destroy() SESSION.save() shutdown_application()
for info in g.psys.list_plugin_info_by_category(category): print(' name : ', info.name) print(' description: ', info.description) print(' version : ', info.version) elif command == 'guess-host': for plugin in g.psys.category('NetworkProvider'): result = plugin.find() if result is not None: host, port = result print(host, ':', port) break else: print('Nothing found. Not even a default.') elif command == 'dir': store = boot_store() def print_dirs(path=None, depth=-1): for p in store.query_directories(path, depth): print(p) print('-' * 40) print_dirs(None, 0) print_dirs(None, 1) print_dirs('Musik/Knorkator/Das nächste Album aller Zeiten', -1) print_dirs('*.flac', -1) shutdown_application()