def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.line_stream,
                     produces=FORMAT.record)
     self.current_record = None
 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')
Exemple #3
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.record_array)
     self.refiners = dict()
Exemple #4
0
    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')
Exemple #5
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.any,
                     produces=FORMAT.any)
     self.packet_list = []
Exemple #6
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.record_array)
     self.current_record = None
Exemple #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)
Exemple #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)
Exemple #9
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)
Exemple #10
0
 def __init__(self, configdict, section, vsiname):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.record,
                     produces=FORMAT.string)
     self.vsiname = vsiname
Exemple #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)
Exemple #12
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.any,
                     produces=FORMAT.any)
     self.converter = None
Exemple #13
0
 def __init__(self, configdict, section):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=FORMAT.any,
                     produces=FORMAT.string)
     log.info("working dir %s" % os.getcwd())
Exemple #14
0
    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)
Exemple #15
0
    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()
Exemple #16
0
    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()
Exemple #17
0
 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)
Exemple #18
0
 def __init__(self,
              configdict,
              section,
              consumes=FORMAT.any,
              produces=FORMAT.string):
     Filter.__init__(self,
                     configdict,
                     section,
                     consumes=consumes,
                     produces=produces)
Exemple #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()
Exemple #20
0
    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')
Exemple #21
0
 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()
Exemple #22
0
    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)
Exemple #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))
Exemple #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)
Exemple #25
0
    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)
Exemple #26
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.geojson_collection, produces=FORMAT.geojson_collection)
Exemple #27
0
    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)
Exemple #28
0
 def __init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.any):
     Filter.__init__(self, configdict, section, consumes, produces)
Exemple #29
0
 def __init__(self, configdict, section, consumes, produces):
     Filter.__init__(self, configdict, section, consumes, produces)
 def __init__(self, configdict, section, consumes=FORMAT.string, produces=FORMAT.string):
     Filter.__init__(self, configdict, section, consumes, produces)
Exemple #31
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.record, produces=FORMAT.record_array)
     self.current_record = None
 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
Exemple #33
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.any)
     self.packet_list = []
Exemple #34
0
 def __init__(self,
              configdict,
              section,
              consumes=FORMAT.record,
              produces=FORMAT.record):
     Filter.__init__(self, configdict, section, consumes, produces)
Exemple #35
0
 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')
Exemple #36
0
 def __init__(self, configdict, section, consumes, produces):
     Filter.__init__(self, configdict, section, consumes, produces)
Exemple #37
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.etree_doc, produces=FORMAT.etree_doc)
Exemple #38
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.string)
     log.info("working dir %s" % os.getcwd())
Exemple #39
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.any, produces=FORMAT.any)
     self.converter = None
Exemple #40
0
 def __init__(self, configdict, section):
     Filter.__init__(self, configdict, section, consumes=FORMAT.line_stream, produces=FORMAT.record)
     self.current_record = None
Exemple #41
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))