コード例 #1
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.line_stream,
                     produces=FORMAT.record)
     self.current_record = None
コード例 #2
0
ファイル: zipfileextractor.py プロジェクト: petersmythe/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.string)
     self.cur_file_path = self.cfg.get('file_path')
コード例 #3
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.record_array)
     self.refiners = dict()
コード例 #4
0
ファイル: osmmfilter.py プロジェクト: Why-Not-Sky/stetl
    def __init__(self, configdict, section):
        Filter.__init__(self, configdict, section, consumes=FORMAT.etree_element, produces=FORMAT.etree_element)

        # Create specific preparer object from given class name string
        self.prep_class = self.cfg.get('prep_class')
        self.prep_class = factory.class_forname(self.prep_class)
        self.preparer = self.prep_class('stetl')
コード例 #5
0
ファイル: packetbuffer.py プロジェクト: pombredanne/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.any,
                     produces=FORMAT.any)
     self.packet_list = []
コード例 #6
0
ファイル: refiner.py プロジェクト: giovibal/smartemission
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.record_array)
     self.current_record = None
コード例 #7
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.string, produces=FORMAT.etree_element)
     self.context = None
     self.root = None
     self.cur_file_path = None
     self.elem_count = 0
     log.info("Element tags to be matched: %s" % self.element_tags)
コード例 #8
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.string, produces=FORMAT.etree_element)
     self.context = None
     self.root = None
     self.cur_file_path = None
     self.elem_count = 0
     log.info("Element tags to be matched: %s" % self.element_tags)
コード例 #9
0
ファイル: gmlsplitter.py プロジェクト: geopython/stetl
    def __init__(self, configdict, section='gml_splitter'):
        Filter.__init__(self, configdict, section, consumes=FORMAT.xml_line_stream, produces=FORMAT.etree_doc)

        log.info("cfg = %s" % self.cfg.to_string())
        self.max_features = self.cfg.get_int('max_features', 10000)
        # File preamble
        self.start_container = self.cfg.get('start_container')
        # File postamble
        self.end_container = self.cfg.get('end_container')
        self.container_tag = self.cfg.get('container_tag')
        #        self.feature_tags = self.cfg.get('feature_tags').split(',')
        self.start_feature_markers = self.cfg.get('start_feature_markers').split(',')
        self.end_feature_markers = self.cfg.get('end_feature_markers').split(',')
        self.feature_count = 0
        self.total_feature_count = 0
        self.in_heading = True

        # End of file is line with end_container_tag
        self.end_container_tag = '</%s' % self.container_tag

        # Derive start and end tags from feature_tags
        #        for feature_tag in self.feature_tags:
        #            self.start_feature_markers.append('<%s' % feature_tag)
        #            self.end_feature_markers.append('</%s>' % feature_tag)
        self.expect_end_feature_markers = []
        self.expect_end_feature_tag = None
        self.buffer = None
        # Reusable XML parser
        self.xml_parser = etree.XMLParser(remove_blank_text=True)
コード例 #10
0
 def __init__(self, configdict, section, vsiname):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.string)
     self.vsiname = vsiname
コード例 #11
0
    def __init__(self, configdict, section='gml_splitter'):
        Filter.__init__(self,
                        configdict,
                        section,
                        consumes=FORMAT.xml_line_stream,
                        produces=FORMAT.etree_doc)

        log.info("cfg = %s" % self.cfg.to_string())
        self.max_features = self.cfg.get_int('max_features', 10000)
        # File preamble
        self.start_container = self.cfg.get('start_container')
        # File postamble
        self.end_container = self.cfg.get('end_container')
        self.container_tag = self.cfg.get('container_tag')
        #        self.feature_tags = self.cfg.get('feature_tags').split(',')
        self.start_feature_markers = self.cfg.get(
            'start_feature_markers').split(',')
        self.end_feature_markers = self.cfg.get('end_feature_markers').split(
            ',')
        self.feature_count = 0
        self.total_feature_count = 0
        self.in_heading = True

        # End of file is line with end_container_tag
        self.end_container_tag = '</%s' % self.container_tag

        # Derive start and end tags from feature_tags
        #        for feature_tag in self.feature_tags:
        #            self.start_feature_markers.append('<%s' % feature_tag)
        #            self.end_feature_markers.append('</%s>' % feature_tag)
        self.expect_end_feature_markers = []
        self.expect_end_feature_tag = None
        self.buffer = None
        # Reusable XML parser
        self.xml_parser = etree.XMLParser(remove_blank_text=True)
コード例 #12
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.any,
                     produces=FORMAT.any)
     self.converter = None
コード例 #13
0
ファイル: packetwriter.py プロジェクト: gitter-badger/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.any,
                     produces=FORMAT.string)
     log.info("working dir %s" % os.getcwd())
コード例 #14
0
ファイル: regexfilter.py プロジェクト: petersmythe/stetl
    def __init__(self,
                 configdict,
                 section,
                 consumes=FORMAT.string,
                 produces=FORMAT.record):
        Filter.__init__(self, configdict, section, consumes, produces)

        self.regex_object = re.compile(self.pattern_string, re.S)
コード例 #15
0
ファイル: xsltfilter.py プロジェクト: geopython/stetl
    def __init__(self, configdict, section):
        Filter.__init__(self, configdict, section, consumes=FORMAT.etree_doc, produces=FORMAT.etree_doc)

        self.xslt_file = open(self.script, 'r')

        # Parse XSLT file only once
        self.xslt_doc = etree.parse(self.xslt_file)
        self.xslt_obj = etree.XSLT(self.xslt_doc)
        self.xslt_file.close()
コード例 #16
0
ファイル: xsltfilter.py プロジェクト: thijsbrentjens/stetl
    def __init__(self, configdict, section):
        Filter.__init__(self, configdict, section, consumes=FORMAT.etree_doc, produces=FORMAT.etree_doc)

        self.xslt_file_path = self.cfg.get('script')
        self.xslt_file = open(self.xslt_file_path, 'r')
        # Parse XSLT file only once
        self.xslt_doc = etree.parse(self.xslt_file)
        self.xslt_obj = etree.XSLT(self.xslt_doc)
        self.xslt_file.close()
コード例 #17
0
ファイル: archiveexpander.py プロジェクト: geoloep/stetl
 def __init__(self, configdict, section, consumes, produces):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=consumes,
                     produces=produces)
     self.input_archive_file = None
     if not os.path.exists(self.target_dir):
         os.mkdir(self.target_dir)
コード例 #18
0
ファイル: fileextractor.py プロジェクト: geoloep/stetl
 def __init__(self,
              configdict,
              section,
              consumes=FORMAT.any,
              produces=FORMAT.string):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=consumes,
                     produces=produces)
コード例 #19
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.record_array)
     self.current_record = None
     self.last_id = None
     self.device = Josene()
     self.sensor_defs = self.device.get_sensor_defs()
コード例 #20
0
ファイル: osmmfilter.py プロジェクト: thijsbrentjens/stetl
    def __init__(self, configdict, section):
        Filter.__init__(self,
                        configdict,
                        section,
                        consumes=FORMAT.etree_element_stream,
                        produces=FORMAT.etree_element_stream)

        # Create specific preparer object from given class name string
        self.prep_class = self.cfg.get('prep_class')
        self.prep_class = factory.class_forname(self.prep_class)
        self.preparer = self.prep_class('stetl')
コード例 #21
0
ファイル: calibration.py プロジェクト: tvsltd/docker-se-stetl
 def __init__(self, configdict, section, consumes=FORMAT.record,
              produces=FORMAT.record):
     Filter.__init__(self, configdict, section, consumes, produces)
     self.pipeline = None
     self.current_target = None
     self.current_target_id = None
     self.other_targets = None
     self._filter = ['s_coresistance', 's_no2resistance', 's_o3resistance']
     self._return_gs_elem = ['cv_results_', 'best_estimator_',
                             'best_score_', 'best_params_', 'best_index_',
                             'scorer_', 'n_splits_']
     self.sensor_defs = Josene().get_sensor_defs()
コード例 #22
0
ファイル: xmlassembler.py プロジェクト: fsteggink/stetl
    def __init__(self, configdict, section):
        Filter.__init__(self, configdict, section, consumes=FORMAT.etree_element, produces=FORMAT.etree_doc)

        log.info("cfg = %s" % self.cfg.to_string())
        self.max_elements = self.cfg.get_int('max_elements', 10000)
        self.container_doc = self.cfg.get('container_doc')
        self.element_container_xpath = XmlAssembler.xpath_base % self.cfg.get('element_container_tag')
        self.total_element_count = 0
        self.element_arr = []

        # Reusable XML parser
        self.xml_parser = etree.XMLParser(remove_blank_text=True)
コード例 #23
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.etree_doc,
                     produces=FORMAT.etree_doc)
     self.enabled = self.cfg.get_bool('enabled', True)
     self.xsd = self.cfg.get('xsd')
     log.info(
         "Building the Schema once with (GML XSD) dependencies for schema=%s (be patient...)"
         % self.xsd)
     self.schema = etree.XMLSchema(etree.parse(self.xsd))
コード例 #24
0
    def __init__(self, configdict, section='gml_feature_extractor'):
        Filter.__init__(self, configdict, section, consumes=FORMAT.etree_doc, produces=FORMAT.etree_feature_array)

        log.info("cfg = %s" % self.cfg.to_string())

        # Build the Xpath expresion from configures tagnames
        self.feature_tags = self.cfg.get('feature_tags').split(',')
        self.total_features = 0
        self.xpath_expression = ''
        index = 0
        for feature_tag in self.feature_tags:
            if index > 0:
                self.xpath_expression += '|'
            self.xpath_expression += GmlFeatureExtractor.xpath_base % feature_tag
            index += 1

        log.info("xpath expression = %s" % self.xpath_expression)
コード例 #25
0
ファイル: xmlassembler.py プロジェクト: thijsbrentjens/stetl
    def __init__(self, configdict, section):
        Filter.__init__(self,
                        configdict,
                        section,
                        consumes=FORMAT.etree_element_stream,
                        produces=FORMAT.etree_doc)

        log.info("cfg = %s" % self.cfg.to_string())
        self.max_elements = self.cfg.get_int('max_elements', 10000)
        self.container_doc = self.cfg.get('container_doc')
        self.element_container_xpath = XmlAssembler.xpath_base % self.cfg.get(
            'element_container_tag')
        self.total_element_count = 0
        self.element_arr = []

        # Reusable XML parser
        self.xml_parser = etree.XMLParser(remove_blank_text=True)
コード例 #26
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.geojson_collection, produces=FORMAT.geojson_collection)
コード例 #27
0
ファイル: regexfilter.py プロジェクト: fsteggink/stetl
    def __init__(self, configdict, section, consumes=FORMAT.string, produces=FORMAT.record):
        Filter.__init__(self, configdict, section, consumes, produces)

        self.regex_object = re.compile(self.pattern_string, re.S)
コード例 #28
0
ファイル: nullfilter.py プロジェクト: fsteggink/stetl
 def __init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.any):
     Filter.__init__(self, configdict, section, consumes, produces)
コード例 #29
0
ファイル: stringfilter.py プロジェクト: fsteggink/stetl
 def __init__(self, configdict, section, consumes, produces):
     Filter.__init__(self, configdict, section, consumes, produces)
コード例 #30
0
 def __init__(self, configdict, section, consumes=FORMAT.string, produces=FORMAT.string):
     Filter.__init__(self, configdict, section, consumes, produces)
コード例 #31
0
ファイル: refiner.py プロジェクト: Geonovum/smartemission
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.record, produces=FORMAT.record_array)
     self.current_record = None
コード例 #32
0
 def __init__(self, config_dict, section):
     Filter.__init__(self, config_dict, section,
                     consumes=[FORMAT.record_array, FORMAT.record],
                     produces=[FORMAT.record_array, FORMAT.record])
     self.last_ids = None
     self.db = None
コード例 #33
0
ファイル: packetbuffer.py プロジェクト: geopython/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.any)
     self.packet_list = []
コード例 #34
0
ファイル: calibration.py プロジェクト: giovibal/smartemission
 def __init__(self,
              configdict,
              section,
              consumes=FORMAT.record,
              produces=FORMAT.record):
     Filter.__init__(self, configdict, section, consumes, produces)
コード例 #35
0
ファイル: zipfileextractor.py プロジェクト: geopython/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.record, produces=FORMAT.string)
     self.cur_file_path = self.cfg.get('file_path')
コード例 #36
0
 def __init__(self, configdict, section, consumes, produces):
     Filter.__init__(self, configdict, section, consumes, produces)
コード例 #37
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.etree_doc, produces=FORMAT.etree_doc)
コード例 #38
0
ファイル: packetwriter.py プロジェクト: fsteggink/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.string)
     log.info("working dir %s" % os.getcwd())
コード例 #39
0
ファイル: formatconverter.py プロジェクト: geopython/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.any)
     self.converter = None
コード例 #40
0
ファイル: raw2measurements.py プロジェクト: Geonovum/sospilot
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.line_stream, produces=FORMAT.record)
     self.current_record = None
コード例 #41
0
ファイル: xmlvalidator.py プロジェクト: Why-Not-Sky/stetl
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.etree_doc, produces=FORMAT.etree_doc)
     self.enabled = self.cfg.get_bool('enabled', True)
     self.xsd = self.cfg.get('xsd')
     log.info("Building the Schema once with (GML XSD) dependencies for schema=%s (be patient...)" % self.xsd)
     self.schema = etree.XMLSchema(etree.parse(self.xsd))