Ejemplo n.º 1
0
    def __init__(self, cfgfiles=None):
        global LOGGER

        config.load_configuration(cfgfiles)

        LOGGER = get_logger(file=config.get_config_value('logging', 'file'),
                            level=config.get_config_value('logging', 'level'),
                            format=config.get_config_value(
                                'logging', 'format'))

        self.max_time = int(config.get_config_value('jobqueue', 'pause'))
        self.maxparallel = int(
            config.get_config_value('server', 'parallelprocesses'))
Ejemplo n.º 2
0
Archivo: job.py Proyecto: tlvu/pywps
    def _run_job(self, filename):
        global LOGGER

        job = Job.load(filename)
        # init config
        if 'PYWPS_CFG' in os.environ:
            config.load_configuration(os.environ['PYWPS_CFG'])
        # update PATH
        os.environ['PATH'] = "{0}:{1}".format(
            config.get_config_value('processing', 'path'),
            os.environ.get('PATH'))
        # cd into workdir
        os.chdir(job.workdir)
        # init logger ... code copied from app.Service
        LOGGER = get_logger(file=config.get_config_value('logging', 'file'),
                            level=config.get_config_value('logging', 'level'),
                            format=config.get_config_value(
                                'logging', 'format'))
        job.run()
Ejemplo n.º 3
0
    def __init__(self, processes=None, cfgfiles=None):
        global LOGGER

        processes = processes or []
        config.load_configuration(cfgfiles)

        LOGGER = get_logger(file=config.get_config_value('logging', 'file'),
                            level=config.get_config_value('logging', 'level'),
                            format=config.get_config_value(
                                'logging', 'format'))

        if not processes:
            # load processes from processes_module.processes_list
            pname = config.get_config_value('server', 'processes')
            if pname:
                pmodule, plist = pname.rsplit('.', 1)
                processes = getattr(importlib.import_module(pmodule), plist)

        # ordered dict of processes
        self.processes = OrderedDict((p.identifier, p) for p in processes)