Commits

nakamura committed 34aefe1

pass user config through MainWindow's argument

  • Participants
  • Parent commits f1301de

Comments (0)

Files changed (1)

         window_size = (800, 640),
     )
 
-    def __init__(self, *args, **kwargs):
+    def __init__(self, config=None, *args, **kwargs):
         super(MainWindow, self).__init__(*args, **kwargs)
 
+        if config is not None:
+            self.config.update(config)
+
         self.set_default_size(*self.config.window_size)
 
         self._scrolled = Gtk.ScrolledWindow()
     if os.path.exists(opt.config_file):
         execfile(opt.config_file, user_config)
 
-    w = MainWindow()
-    w.config.update(user_config)
-
+    w = MainWindow(config=user_config)
     w.show_all()
-
     w.open(*args)
 
     Gtk.main()