Commits

elbaschid committed 4075e80

moved code to main() function

  • Participants
  • Parent commits 5f4626a

Comments (0)

Files changed (1)

File revelation_indicator.py

 #	if len(pixbufs) > 0:
 #	    gtk.window_set_default_icon_list(*pixbufs)
 #
-        # set up popup menu
-        #self.applet.setup_menu("""
-		#	<popup name="button3">
-		#		<menuitem name="file-unlock"	verb="file-unlock"	label=\"""" + _('Unlock File') + """\"		pixtype="stock" pixname="revelation-unlock" />
-		#		<menuitem name="file-lock"	verb="file-lock"	label=\"""" + _('Lock File') + """\"		pixtype="stock" pixname="revelation-lock" />
-		#		<menuitem name="file-reload"	verb="file-reload"	label=\"""" + _('Reload File') + """\"		pixtype="stock" pixname="revelation-reload" />
-		#		<separator />
-		#		<menuitem name="revelation"	verb="revelation"	label=\"""" + _('Start Revelation') + """\"	pixtype="stock" pixname="revelation-revelation" />
-		#		<menuitem name="prefs"		verb="prefs"		label=\"""" + _('Preferences') + """\"		pixtype="stock"	pixname="gtk-properties" />
-		#		<menuitem name="about"		verb="about"		label=\"""" + _('About') + """\"		pixtype="stock"	pixname="gnome-stock-about" />
-		#	</popup>
-		#""", (
-		#	( "about",		lambda w,d=None: self.about() ),
-		#	( "file-lock",		lambda w,d=None: self.file_close() ),
-		#	( "file-reload",	lambda w,d=None: self.file_reload() ),
-		#	( "file-unlock",	lambda w,d=None: self.file_open(self.config.get("file")) ),
-		#	( "prefs",		lambda w,d=None: self.prefs() ),
-		#	( "revelation",		lambda w,d=None: util.execute_child("@bindir@/revelation") ),
-		#), None)
+        ##NOTE: some code removed
 
-		## set up ui items
-		#self.entry = ui.Entry()
-		#self.entry.set_width_chars(14)
-		#self.entry.connect("activate", self.__cb_entry_activate)
-		#self.entry.connect("button_press_event", self.__cb_entry_buttonpress)
-		#self.entry.connect("key_press_event", lambda w,d=None: self.locktimer.reset())
+        ## set up ui items
+        #self.entry = ui.Entry()
+        #self.entry.set_width_chars(14)
+        #self.entry.connect("activate", self.__cb_entry_activate)
+        #self.entry.connect("button_press_event", self.__cb_entry_buttonpress)
+        #self.entry.connect("key_press_event", lambda w,d=None: self.locktimer.reset())
 
-		#self.icon = ui.Image()
-		#self.eventbox = ui.EventBox(self.icon)
-		#self.eventbox.connect("button_press_event", self.__cb_icon_buttonpress)
+        #self.icon = ui.Image()
+        #self.eventbox = ui.EventBox(self.icon)
+        #self.eventbox.connect("button_press_event", self.__cb_icon_buttonpress)
 
-		#self.hbox = ui.HBox(self.eventbox, self.entry)
-		#self.applet.add(self.hbox)
-		#
-		## handle Gnome Panel background
-		#self.applet.connect("change-background",self.panel_bg)
+        #self.hbox = ui.HBox(self.eventbox, self.entry)
+        #self.applet.add(self.hbox)
+        #
+        ## handle Gnome Panel background
+        #self.applet.connect("change-background",self.panel_bg)
 
-		#self.applet.show_all()
+        #self.applet.show_all()
 
-		## set up various ui element holders
-		#self.popup_entryview	= None
-		#self.popup_entrylist	= None
+        ## set up various ui element holders
+        #self.popup_entryview	= None
+        #self.popup_entrylist	= None
 
-		#self.entrymenu		= None
+        #self.entrymenu		= None
 
     def file_close(self):
         self.__close_popups()
         self.connect("show", lambda w: self.button_close.grab_focus())
 
 
-def main(options=None):
-    revelation_indicator = RevelationIndicator(options)
-
-    gtk.main()
-
-
-if __name__ == "__main__":
-   
+def main():
     parser = argparse.ArgumentParser()
     parser.add_argument('-d', '--debug', action='store_true', default=False)
     parser.add_argument('-f', '--file', default='')
     if options.debug:
         logger.setLevel(logging.DEBUG)
 
-    main(options)
+    revelation_indicator = RevelationIndicator(options)
+
+    gtk.main()
+
+
+if __name__ == "__main__":
+    main()