Пример #1
0
 def __init__(self, input_path='', decider='input: bool(input)', namespace=None, **kw):
     self.input_path = input_path
     if namespace is None:
         namespace = dict()
     self.namespace = namespace
     self.decider = util.create_lambda_function(decider, self=self, **self.namespace)
     super(Stopper, self).__init__(**kw)
Пример #2
0
    def __init__(
        self,
        path,
        defaultType="text/html",
        ignoredExts=(),
        registry=None,
        allowExt=0,
        namespace=None,
        preprocessors=None,
        **kwargs
    ):
        static.File.__init__(
            self,
            util.expand_filepath(path),
            defaultType=defaultType,
            ignoredExts=ignoredExts,
            registry=registry,
            allowExt=allowExt,
            **kwargs
        )

        self.namespace = dict(self=self)
        self.namespace.update(namespace or dict())
        self.preprocessor_definitions = preprocessors or dict()

        self.preprocessors = list()
        for lambda_definition in self.preprocessor_definitions.values():
            func = util.create_lambda_function(lambda_definition, **self.namespace)
            self.preprocessors.append(func)
Пример #3
0
 def configure(self, runtime_environment):
     for name, dependency_configuration in self.dependency_map.items():
         # if the configuration is a string, assume the string is a provider
         if isinstance(dependency_configuration, basestring):
             self.dependency_map[name] = dict(provider=dependency_configuration)
     
     self.runtime_environment = runtime_environment
     self.dependencies = runtime_environment.create_dependency_map(self, **self.dependency_map)
     self.lambda_ = util.create_lambda_function(self.lambda_definition, self=self, **self.namespace)
Пример #4
0
 def configure(self, runtime_environment):
     self.formatter = util.create_lambda_function(self.formatter_definition, self=self, **self.namespace)
Пример #5
0
 def configure(self, runtime_environment):
     self.pipeline_dependency = runtime_environment.dependency_manager.add_dependency(self, dict(provider='pipeline.%s' % self.pipeline_name))
     self.result_processor = util.create_lambda_function(self.result_processor_definition, self=self, **self.namespace)