def password_set(self, text): if text == "-*-unchanged-*-": return if text: text = rcd_util.md5ify_password(text) self.password = text
def get_daemon_info(self): local = self.local_rb.get_active() url = self.url.entry.get_text() user = self.user.get_text() password = self.password.get_text() if password == "-*-unchanged-*-": password = self.data.password_get() else: password = rcd_util.md5ify_password(password) return (local, url, user, password)
def main(version): global red_version red_version = version print "%s %s" % (red_name, version) print red_copyright print argv = sys.argv[1:] opt_dict, args = red_option.process_argv(argv) if opt_dict.has_key("version"): sys.exit(0) if opt_dict.has_key("help"): red_option.usage() sys.exit(0) if opt_dict.has_key("local") and opt_dict.has_key("host"): print _("ERROR: You cannot specify both -h/--host and -l/--local options") sys.exit(1) local = 0 host = None username = None password = None if opt_dict.has_key("local"): local = 1 if opt_dict.has_key("host"): host = opt_dict["host"] if host[0] == "/": local = 1 elif opt_dict.has_key("user"): local = 0 if host: if opt_dict.has_key("user"): username = opt_dict["user"] else: username = getpass.getuser() if opt_dict.has_key("password"): password = opt_dict["password"] else: # This'll always fail and pop up the dialog. password = "" else: if opt_dict.has_key("user"): print _("ERROR: You cannot specify a user to a local daemon") sys.exit(1) if opt_dict.has_key("host"): url = opt_dict["host"] # Try the command-line options or the saved data first # Enclosed in an empty try-except because we don't care about the # error on the first connect. server = None dd = red_settings.DaemonData() try: if local or host: if password: pw_md5 = rcd_util.md5ify_password(password) else: pw_md5 = None dd.data_set((local, host, username, password)) server = red_connection.connect(local, host, username, pw_md5) else: connect_info = dd.data_get() local = connect_info[0] server = red_connection.connect(*connect_info) except: pass # That failed, pop up the dialog if server is None: server, local = red_connection.connect_from_window() if server is None: sys.exit(1) rcd_util.register_server(server, local) if debug: ticker() app = red_appwindow.AppWindow(server) app.set_title(get_title()) app.register_component(red_updates.UpdatesComponent()) app.register_component(red_software.InstalledComponent()) app.register_component(red_software.AvailableComponent()) app.register_component(red_search.SearchComponent()) app.register_component(red_bundlecomponent.BundleComponent()) if rcd_util.server_has_patch_support(server): app.register_component(red_patches.PatchComponent()) app.register_component(red_history.HistoryComponent()) app.register_component(red_transaction.TransactionComponent()) app.show() #add files to install from the cmdline if len(args) > 0: ret = red_installfiles.install_files(args) if not ret: red_appwindow.run_transaction_cb(app) gtk.main() global red_running red_running = 0 # This will terminate all our child threads without joining os._exit(0)
def pwd_set(self, pwd): if pwd: self.pwd = rcd_util.md5ify_password(pwd) else: self.pwd = None
def main(version): if check_running(): import gtk dialog = gtk.MessageDialog( None, 0, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, _("There appears to be a Red Carpet " "update icon already running. Exiting.")) dialog.run() dialog.destroy() return 1 write_pid() global red_version red_version = version print "Red Carpet Notification Tray Icon %s" % version print "Copyright (C) 2002-2004 Novell, Inc." print argv = sys.argv[1:] opt_dict, args = red_option.process_argv(argv) if opt_dict.has_key("version"): sys.exit(0) if opt_dict.has_key("help"): red_option.usage() sys.exit(0) if opt_dict.has_key("local") and opt_dict.has_key("host"): print _( "ERROR: You cannot specify both -h/--host and -l/--local options") sys.exit(1) local = 0 host = None username = None password = None if opt_dict.has_key("local"): local = 1 if opt_dict.has_key("host"): host = opt_dict["host"] if host[0] == "/": local = 1 elif opt_dict.has_key("user"): local = 0 if host: if opt_dict.has_key("user"): username = opt_dict["user"] else: username = getpass.getuser() if opt_dict.has_key("password"): password = opt_dict["password"] else: # This'll always fail and pop up the dialog. password = "" else: if opt_dict.has_key("user"): print _("ERROR: You cannot specify a user to a local daemon") sys.exit(1) if opt_dict.has_key("host"): url = opt_dict["host"] # Try the command-line options or the saved data first # Enclosed in an empty try-except because we don't care about the # error on the first connect. server = None dd = red_settings.DaemonData() try: if local or host: if password: pw_md5 = rcd_util.md5ify_password(password) else: pw_md5 = None dd.data_set((local, host, username, password)) server = red_connection.connect(local, host, username, pw_md5) else: connect_info = dd.data_get() local = connect_info[0] server = red_connection.connect(*connect_info) except: pass # That failed, pop up the dialog if server is None: import red_main red_main.red_name = red_name red_main.red_version = red_version server, local = red_connection.connect_from_window() if server is None: sys.exit(1) rcd_util.register_server(server, local) import gtk icon = UpdateIcon() icon.show_all() gtk.main() delete_pid() global red_running red_running = 0 # This will terminate all our child threads without joining os._exit(0)
def main(version): if check_running(): import gtk dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, _("There appears to be a Red Carpet " "update icon already running. Exiting.")) dialog.run() dialog.destroy() return 1 write_pid() global red_version red_version = version print "Red Carpet Notification Tray Icon %s" % version print "Copyright (C) 2002-2004 Novell, Inc." print argv = sys.argv[1:] opt_dict, args = red_option.process_argv(argv) if opt_dict.has_key("version"): sys.exit(0) if opt_dict.has_key("help"): red_option.usage() sys.exit(0) if opt_dict.has_key("local") and opt_dict.has_key("host"): print _("ERROR: You cannot specify both -h/--host and -l/--local options") sys.exit(1) local = 0 host = None username = None password = None if opt_dict.has_key("local"): local = 1 if opt_dict.has_key("host"): host = opt_dict["host"] if host[0] == "/": local = 1 elif opt_dict.has_key("user"): local = 0 if host: if opt_dict.has_key("user"): username = opt_dict["user"] else: username = getpass.getuser() if opt_dict.has_key("password"): password = opt_dict["password"] else: # This'll always fail and pop up the dialog. password = "" else: if opt_dict.has_key("user"): print _("ERROR: You cannot specify a user to a local daemon") sys.exit(1) if opt_dict.has_key("host"): url = opt_dict["host"] # Try the command-line options or the saved data first # Enclosed in an empty try-except because we don't care about the # error on the first connect. server = None dd = red_settings.DaemonData() try: if local or host: if password: pw_md5 = rcd_util.md5ify_password(password) else: pw_md5 = None dd.data_set((local, host, username, password)) server = red_connection.connect(local, host, username, pw_md5) else: connect_info = dd.data_get() local = connect_info[0] server = red_connection.connect(*connect_info) except: pass # That failed, pop up the dialog if server is None: import red_main red_main.red_name = red_name red_main.red_version = red_version server, local = red_connection.connect_from_window() if server is None: sys.exit(1) rcd_util.register_server(server, local) import gtk icon = UpdateIcon() icon.show_all() gtk.main() delete_pid() global red_running red_running = 0 # This will terminate all our child threads without joining os._exit(0)
def main(version): global red_version red_version = version print "%s %s" % (red_name, version) print red_copyright print argv = sys.argv[1:] opt_dict, args = red_option.process_argv(argv) if opt_dict.has_key("version"): sys.exit(0) if opt_dict.has_key("help"): red_option.usage() sys.exit(0) if opt_dict.has_key("local") and opt_dict.has_key("host"): print _( "ERROR: You cannot specify both -h/--host and -l/--local options") sys.exit(1) local = 0 host = None username = None password = None if opt_dict.has_key("local"): local = 1 if opt_dict.has_key("host"): host = opt_dict["host"] if host[0] == "/": local = 1 elif opt_dict.has_key("user"): local = 0 if host: if opt_dict.has_key("user"): username = opt_dict["user"] else: username = getpass.getuser() if opt_dict.has_key("password"): password = opt_dict["password"] else: # This'll always fail and pop up the dialog. password = "" else: if opt_dict.has_key("user"): print _("ERROR: You cannot specify a user to a local daemon") sys.exit(1) if opt_dict.has_key("host"): url = opt_dict["host"] # Try the command-line options or the saved data first # Enclosed in an empty try-except because we don't care about the # error on the first connect. server = None dd = red_settings.DaemonData() try: if local or host: if password: pw_md5 = rcd_util.md5ify_password(password) else: pw_md5 = None dd.data_set((local, host, username, password)) server = red_connection.connect(local, host, username, pw_md5) else: connect_info = dd.data_get() local = connect_info[0] server = red_connection.connect(*connect_info) except: pass # That failed, pop up the dialog if server is None: server, local = red_connection.connect_from_window() if server is None: sys.exit(1) rcd_util.register_server(server, local) if debug: ticker() app = red_appwindow.AppWindow(server) app.set_title(get_title()) app.register_component(red_updates.UpdatesComponent()) app.register_component(red_software.InstalledComponent()) app.register_component(red_software.AvailableComponent()) app.register_component(red_search.SearchComponent()) app.register_component(red_bundlecomponent.BundleComponent()) if rcd_util.server_has_patch_support(server): app.register_component(red_patches.PatchComponent()) app.register_component(red_history.HistoryComponent()) app.register_component(red_transaction.TransactionComponent()) app.show() #add files to install from the cmdline if len(args) > 0: ret = red_installfiles.install_files(args) if not ret: red_appwindow.run_transaction_cb(app) gtk.main() global red_running red_running = 0 # This will terminate all our child threads without joining os._exit(0)