Archived
1
0
This repository has been archived on 2025-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
Fourmi/GUI/configImporter.py
2014-06-17 23:34:52 +02:00

31 lines
964 B
Python

import ConfigParser
class ConfigImporter():
def __init__(self, filename):
"""Read the filename into the parser."""
self.filename = filename
self.parser = ConfigParser.ConfigParser()
self.parser.read(self.filename)
def load_common_attributes(self):
"""Loads common attributes from the initialized file."""
try:
return self.parser.get('GUI_Options', 'CommonParameters')
except:
return 'One, Two, Three'
def load_output_types(self):
"""Loads output types from the initialized file."""
try:
return self.parser.get('GUI_Options', 'OutputTypes')
except:
return 'csv'
def load_always_attributes(self):
"""Loads attributes that are always searched for from the initialized file."""
try:
return self.parser.get('GUI_Options', 'AlwaysParameters')
except:
return 'Name, Weight'