def get_values(contact_url): 'Get Values For New Job, Overwrites Placeholders With Input Data' values_dict = {} msg = "Einstellungen" title = "Dateneingabe" fieldNames = ["Zu spiegelnde URL", "SURT"] fieldValues = [] fieldValues = easygui.multenterbox(msg, title, fieldNames) if fieldValues == None: pass else: values_dict["http://example.example/example"] = fieldValues[0] + "\n" + fieldValues[1] values_dict['ENTER_AN_URL_WITH_YOUR_CONTACT_INFO_HERE_FOR_WEBMASTERS_AFFECTED_BY_YOUR_CRAWL'] = contact_url return values_dict
def config_me(): 'Configurator For HeriGUY. Heritrix Credentials' msg = "HeriGUY Konfiguration" title = "HeriGUY v0.2" fieldNames = ["https://HOST[:PORT]", "Benutzername", "Passwort", "Kontakt-URL"] fieldValues = [] fieldValues = easygui.multenterbox(msg, title, fieldNames) if fieldValues == None: easygui.msgbox("HeriGUY benoetigt eine Konfiguration. Breche ab.") sys.exit(0) else: config = ConfigParser.RawConfigParser() config.add_section('Heritrix') config.set('Heritrix', 'url', fieldValues[0]) config.set('Heritrix', 'user', fieldValues[1]) config.set('Heritrix', 'passwd', fieldValues[2]) config.set('Heritrix', 'contact_url', fieldValues[3]) with open('config/main.cfg', 'wb') as configfile: config.write(configfile) easygui.msgbox("Konfiguration erfolgreich gespeichert.")