def main(): print(machine_information.get_information()) print('My-Weather-Indicator version: %s' % comun.VERSION) print('#####################################################') Notify.init("my-weather-indicator") mwi = MWI() Gtk.main()
def main(): DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() request = bus.request_name('es.atareao.TouchpadIndicator',dbus.bus.NAME_FLAG_DO_NOT_QUEUE) if request == dbus.bus.REQUEST_NAME_REPLY_EXISTS or len(sys.argv)>1: print('Another instance of Touchpad Indicator is working') usage_msg = _('usage: %prog [options]') parser = OptionParser(usage=usage_msg, add_help_option=False) parser.add_option('-h', '--help', action='store_true', dest='help', default=False, help=_('show this help and exit.')) parser.add_option('-c', '--change-state', action='store_true', dest='change', default=False, help=_('change the touchpad state. If indicator is not running launch it.')) parser.add_option('-s', '--show-icon', action='store_true', dest='show', default=False, help=_('show the icon if indicator is hidden. Default action. If indicator is not running launch it.')) parser.add_option('-l', '--list-devices', action='store_true', dest='list', default=False, help=_('list devices')) (options, args) = parser.parse_args() if options.help: parser.print_help() elif options.list: device_list.list() elif options.change: change_status() else: # show by default make_visible() exit(0) else: # first!!! #################################################################### print('#####################################################') print(machine_information.get_information()) print('Touchpad-Indicator version: %s'%comun.VERSION) print('#####################################################') #################################################################### Notify.init("touchpad-indicator") object = bus.get_object('es.atareao.TouchpadIndicator',\ '/es/atareao/TouchpadIndicator') my_service = dbus.Interface(object,'es.atareao.TouchpadIndicator') tpi=TouchpadIndicator() Gtk.main() exit(0)
def main(): DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() request = bus.request_name('es.atareao.TouchpadIndicator', dbus.bus.NAME_FLAG_DO_NOT_QUEUE) if request == dbus.bus.REQUEST_NAME_REPLY_EXISTS or len(sys.argv) > 1: print('Another instance of Touchpad-Indicator is working') usage_msg = _('usage: %prog [options]') parser = OptionParser(usage=usage_msg, add_help_option=False) parser.add_option('-h', '--help', action='store_true', dest='help', default=False, help=_('show this help and exit.')) parser.add_option('-c', '--change-state', action='store_true', dest='change', default=False, help=_('change the touchpad state. If indicator is \ not running launch it.')) parser.add_option('-s', '--show-icon', action='store_true', dest='show', default=False, help=_('show the icon if indicator is hidden. \ Default action. If indicator is not running launch it.')) parser.add_option('-l', '--list-devices', action='store_true', dest='list', default=False, help=_('list devices')) (options, args) = parser.parse_args() if options.help: parser.print_help() elif options.list: device_list.list() elif options.change: change_status() else: print(get_information()) print('Touchpad-Indicator version: %s' % comun.VERSION) Notify.init('Touchpad-Indicator') object = bus.get_object('es.atareao.TouchpadIndicator', '/es/atareao/TouchpadIndicator') dbus.Interface(object, 'es.atareao.TouchpadIndicator') TouchpadIndicator() Gtk.main() exit(0)
def header(fileoutput): fileoutput.write('#####################################################\n') fileoutput.write(machine_information.get_information()) fileoutput.write('Touchpad-Indicator version: %s\n' % comun.VERSION) fileoutput.write('#####################################################\n')
ad.set_logo(GdkPixbuf.Pixbuf.new_from_file(comun.ICON)) ad.set_icon(GdkPixbuf.Pixbuf.new_from_file(comun.ICON)) ad.set_program_name(comun.APPNAME) ad.run() ad.destroy() widget.set_sensitive(True) self.menu_offon(True) def redondea(valor): valor = valor * 10.0 return int(valor)/10.0 def cambia(valor,a): if len(valor)==0: return '' valor = float(valor) if a=='F': return str(redondea(valor*9.0/5.0 + 32.0)) elif a == 'K': return str(redondea(valor+273.15)) return str(valor) if __name__ == "__main__": print(machine_information.get_information()) print('My-Weather-Indicator version: %s'%comun.VERSION) print('#####################################################') Notify.init("my-weather-indicator") mwi=MWI() Gtk.main() exit(0)
rodion <https://launchpad.net/~rodion-samusik>\n\ Sal Inski <https://launchpad.net/~syb3ria>\n\ sfc <https://launchpad.net/~sfc-0>\n\ Sohrab <https://launchpad.net/~sohrab-naushad>\n\ Styrmir Magnússon <https://launchpad.net/~styrmirm>\n\ sylinub <https://launchpad.net/~sylinub>\n\ whochismo <https://launchpad.net/~whochismo>\n') ad.set_documenters( ['Lorenzo Carbonell <*****@*****.**>']) ad.set_artists([ '~mohitg <http://mohitg.deviantart.com/>', '~MerlinTheRed <http://merlinthered.deviantart.com/>' ]) ad.set_logo(GdkPixbuf.Pixbuf.new_from_file(comun.ICON)) ad.set_icon(GdkPixbuf.Pixbuf.new_from_file(comun.ICON)) ad.set_program_name(comun.APPNAME) ad.run() ad.destroy() widget.set_sensitive(True) self.menu_offon(True) if __name__ == "__main__": print(machine_information.get_information()) print('My-Weather-Indicator version: %s' % comun.VERSION) print('#####################################################') Notify.init("my-weather-indicator") mwi = MWI() Gtk.main() exit(0)