def load_config(self): """ Loads config from file and returns loaded JSON object """ try: with open(self._conf_name, 'rb') as conf: return json.load(conf) except IOError, e: #sys.stderr.write(str(e) + '\n') pass
def load_config(self): """ Loads config from file and returns loaded JSON object """ try: with open(self._conf_name, "rb") as conf: return json.load(conf) except IOError, e: # sys.stderr.write(str(e) + '\n') pass
def update_config(self, new_config): """ Reads the JSON config updates it's values with new_config and saves it back as JSON dump :param new_config: """ config = {} try: with open(self._conf_name, 'rb') as conf: config = json.load(conf) except IOError, e: sys.stderr.write(str(e) + '\n')
def update_config(self, new_config): """ Reads the JSON config updates it's values with new_config and saves it back as JSON dump :param new_config: """ config = {} try: with open(self._conf_name, "rb") as conf: config = json.load(conf) except IOError, e: sys.stderr.write(str(e) + "\n")