Esempio n. 1
0
 def _load_config(self, config):
     if os.access(config, os.R_OK):
         with open(config, "r") as conf:
             try:
                 return yaml.safe_load(conf.read())
             except yaml.YAMLError as exc:
                 logger.warning(exc)
                 raise errors.ParseError(
                     'Problem with loading YAML file {0}'.format(config))
     else:
         logger.warning("Config {0} is not readable.".format(config))
Esempio n. 2
0
def p_error(p):
    raise errors.ParseError("Syntax error at '%s'" % getattr(p, 'value', ''))