Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
    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')
Beispiel #4
0
    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")