def main(): """ Where everything start. """ init_logging() set_locale() GObject.threads_init() if hasattr(GLib, "unix_signal_add"): GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT, Gtk.main_quit, None) GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGTERM, Gtk.main_quit, None) try: config = load_config() config.read() main_win = MainWindow(config) ActionRefreshIndex(main_win, config).do() Gtk.main() for scheduler in main_win.schedulers.values(): scheduler.stop() config.write() finally: logger.info("Good bye")
def main(): """ Where everything start. """ locale.setlocale(locale.LC_ALL, '') got_locales = False locales_path = None for (fr_locale_path, locales_path) in LOCALE_PATHS: print "Looking for locales in '%s' ..." % (fr_locale_path) if os.access(fr_locale_path, os.R_OK): print "Will use locales from '%s'" % (locales_path) got_locales = True break if not got_locales: print "WARNING: Locales not found" else: for module in (gettext, gtk.glade): module.bindtextdomain('paperwork', locales_path) module.textdomain('paperwork') gobject.threads_init() config = PaperworkConfig() config.read() main_win = MainWindow(config) main_win.actions['reindex'][1].do() gtk.main() print "Good bye"
def setUp(self): self.instance = MainWindow(Tk())
from tkinter import Tk from frontend.mainwindow import MainWindow window = Tk() app = MainWindow(window) window.mainloop()