def parse(self, filepath): if not os.path.exists(filepath): filepath = os.path.join(utils.get_interfaces_path(), DEFAULT_INTERFACE_FILENAME + '.interface') try: IniFile.parse(self, filepath, ["Interface Entry"]) except Exception, e: print e
def __init__(self, filename=None, udev_object=None): self.content = dict() self.udev_object = udev_object self.parse(os.path.join(utils.get_interfaces_path(), filename + '.interface'))
def new(self, filename): self.content = dict() self.addGroup(self.default_group) self.filename = os.path.join(utils.get_interfaces_path(), filename + '.interface')