def DefaultSetup(self): # Set option values to Default cfgdict = tftpcfg.get_defaults() self.AssignDictToValues(cfgdict) self.ToggleRadio()
if args: configfile = args[0] else: configfile = default_configfile # read configuration values error_text = "" if (not options.nogui) and configfile == default_configfile: # Gui option and default config, if the config file # does not exist, or sections are missing, re-create it try: cfgdict = tftpcfg.getconfig(scriptdirectory, configfile) except tftpcfg.ConfigError, e: # On error fall back to defaults, but warn the user cfgdict = tftpcfg.get_defaults() error_text = "Error in config file:\n" + str(e) + "\nso using defaults" else: # No gui, or not the default config file, # therefore read it with more rigour and exit if any errors try: cfgdict = tftpcfg.getconfigstrict(scriptdirectory, configfile) except tftpcfg.ConfigError, e: print "Error in config file:" print e sys.exit(1) ######## Create the server ###################### # this makes a server object. # It is run in a loop, either using # tftp_engine.loop_nogui(server)