コード例 #1
0
ファイル: client.py プロジェクト: philipz/gantryd
  def getConfig(self):
    """ Returns the project's config or raises an exception if none. """
    config_json = self.getConfigJSON()

    # Parse the project's configuration and save it.
    try:
      self.config = Configuration.parse(config_json)
    except ConfigParseException as cpe:
      fail('Error parsing gantry config', project = self.project_name, exception = cpe)
    except Exception as e:
      self.logger.exception(e)
      
    return self.config
コード例 #2
0
ファイル: gantry.py プロジェクト: mc0/gantryd
def loadConfig(config_file):
    """ Attempts to load and parse the given config file. """
    try:
        with open(config_file, 'r') as f:
            config_json = f.read()
    except:
        print 'Could not find config file: ' + config_file
        return None

    try:
        return Configuration.parse(config_json)
    except Exception as e:
        print 'Error parsing gantry config: ' + str(e)
        return None
コード例 #3
0
ファイル: gantry.py プロジェクト: philipz/gantryd
def loadConfig(config_file):
  """ Attempts to load and parse the given config file. """
  try:
    with open(config_file, 'r') as f:
      config_json = f.read()
  except:
    print 'Could not find config file: ' + config_file
    return None
    
  try:
    return Configuration.parse(config_json)
  except Exception as e:
    print 'Error parsing gantry config: ' + str(e)
    return None
コード例 #4
0
    def getConfig(self):
        """ Returns the project's config or raises an exception if none. """
        config_json = self.getConfigJSON()

        # Parse the project's configuration and save it.
        try:
            self.config = Configuration.parse(config_json)
        except ConfigParseException as cpe:
            fail('Error parsing gantry config',
                 project=self.project_name,
                 exception=cpe)
        except Exception as e:
            self.logger.exception(e)

        return self.config