A web scraper build to search specific information for a given compound (and its pseudonyms)
at develop 940 B view raw
1import ConfigParser 2 3 4class ConfigImporter(): 5 def __init__(self, filename): 6 """Read the filename into the parser.""" 7 self.filename = filename 8 self.parser = ConfigParser.ConfigParser() 9 self.parser.read(self.filename) 10 11 def load_common_attributes(self): 12 """Loads common attributes from the initialized file.""" 13 try: 14 return self.parser.get('GUI', 'CommonParameters') 15 except: 16 return 'One, Two, Three' 17 18 def load_output_types(self): 19 """Loads output types from the initialized file.""" 20 try: 21 return self.parser.get('GUI', 'OutputTypes') 22 except: 23 return 'csv' 24 25 def load_always_attributes(self): 26 """Loads attributes that are always searched for from the initialized file.""" 27 try: 28 return self.parser.get('GUI', 'AlwaysParameters') 29 except: 30 return 'Name, Weight'