Beispiel #1
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # remove the output port since this is a publisher
        self.remove_output('out')

        # solr host, port, and path (core)
        self.set_parameter('host', 'localhost')
        self.set_parameter('port', 8983)
        self.set_parameter('path', '/solr')

        # if we should commit after each batch
        # set to OFF if using the auto commit feature
        self.set_parameter('commit', 'True', ['True', 'False'])

        # wait_flush and wait_searcher
        self.set_parameter('wait_flush', 'True', ['True', 'False'])
        self.set_parameter('wait_searcher', 'True', ['True', 'False'])

        # overwrite previously commited docs with same id
        self.set_parameter('overwrite', 'True', ['True', 'False'])

        # commit within time in milliseconds (0 = disabled)
        self.set_parameter('commit_within', '0')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #2
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        # remove the output port since this is a publisher
        self.remove_output("out")

        # solr host, port, and path (core)
        self.set_parameter("host", "localhost")
        self.set_parameter("port", 8983)
        self.set_parameter("path", "/solr")

        # if we should commit after each batch
        # set to OFF if using the auto commit feature
        self.set_parameter("commit", "True", ["True", "False"])

        # wait_flush and wait_searcher
        self.set_parameter("wait_flush", "True", ["True", "False"])
        self.set_parameter("wait_searcher", "True", ["True", "False"])

        # overwrite previously commited docs with same id
        self.set_parameter("overwrite", "True", ["True", "False"])

        # commit within time in milliseconds (0 = disabled)
        self.set_parameter("commit_within", "0")

        # log successful initialization message
        log.info("Component Initialized: %s" % self.__class__.__name__)
Beispiel #3
0
 def __init__(self):
     # initialize parent class
     Component.__init__(self)
     self.set_parameter('mapfile', 'etc/sample-xmlmap.xml')
     self.set_parameter('input', 'xml')
     self._docroot = './'
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #4
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # Optionally add/remove component ports
        # self.remove_output('out')
        # self.add_input('in2', 'A description of what this port is used for')

        locs = ["World", "Asia", "Africa", "North America", "South America", 
                "Antarctica", "Europe", "Australia"
                "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", 
                "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", 
                "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", 
                "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", 
                "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]

        self.remove_input('in')
        self.remove_output('out')
        self.add_input('source', '(edu.utah.sci.vistrails.basic:String)')
        self.add_output('files', '(edu.utah.sci.vistrails.basic:File)')

        self.set_parameter('From', '1/1/1900', None, 'edu.utah.sci.vistrails.basic:Date')
        self.set_parameter('To   ', '12/31/2012', None, 'edu.utah.sci.vistrails.basic:Date')
        self.set_parameter('Location','World', locs, 'edu.utah.sci.vistrails.basic:String')
        self.set_parameter('MaxItems','1', None, 'edu.utah.sci.vistrails.basic:Integer')
        self.set_package('edu.utah.sci.vistrails.http')
        self.set_version('0.0.1')

        # Setup any user parameters required by this component 
        # 2nd arg is the default value, 3rd arg is optional list of choices
        #self.set_parameter('MyParam', 'opt1', ['opt1', 'opt2', 'opt3'])

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #5
0
 def __init__(self):
     # initialize parent class
     Component.__init__(self)
     self.set_parameter('mapfile', 'etc/sample-xmlmap.xml')
     self.set_parameter('input', 'xml')
     self._docroot = './'
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #6
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        # remove the output port since this is a publisher
        self.remove_output('out')

        # solr host, port, and path (core)
        self.set_parameter('host', 'localhost')
        self.set_parameter('port', 8983)
        self.set_parameter('path', '/solr')

        # if we should commit after each batch
        # set to OFF if using the auto commit feature
        self.set_parameter('commit', 'True', ['True', 'False'])

        # wait_flush and wait_searcher
        self.set_parameter('wait_flush', 'True', ['True', 'False'])
        self.set_parameter('wait_searcher', 'True', ['True', 'False'])

        # overwrite previously commited docs with same id
        self.set_parameter('overwrite', 'True', ['True', 'False'])

        # commit within time in milliseconds (0 = disabled)
        self.set_parameter('commit_within', '0')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # create an instance of the pdf converter
        self._converter = PDFConverter()

        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        #Setup any user parameters required by this component 
        self.set_parameter('fields', '')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #9
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        self.set_parameter('fields', '')
        self.set_parameter('dropvalues', '_any_') 

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #10
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        self.set_parameter('fields', '')
        self.set_parameter('dropvalues', '_any_')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #11
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        #Setup any user parameters required by this component
        self.set_parameter('fields', '')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #12
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # if true, the raw html will be placed in the html field
        self.set_parameter('keep_html', 'False', ['True', 'False'])

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #13
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # the field that contains the address information
        # most likely from the AddressExtractor
        self.set_parameter('address_field', 'addresses')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        self.set_parameter('original_names', '')
        self.set_parameter('new_names', '')
        self.set_parameter('mode', 'Abort', ['Abort', 'Append', 'Overwrite'])

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        self.set_parameter("sources", "")
        self.set_parameter("destinations", "")
        self.set_parameter("mode", "Abort", ["Abort", "Append", "Overwrite"])

        # log successful initialization message
        log.info("Component Initialized: %s" % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        self.set_parameter('sources', '')
        self.set_parameter('destinations', '')
        self.set_parameter('mode', 'Abort', ['Abort', 'Append', 'Overwrite'])

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        Component.__init__(self)
        
        # remove the defaut outport port since this is a PUBLISHER
        self.remove_output('out')

        # create a runtime parameter for the user to specify an output filename 
        self.set_parameter('output directory', '')
        # runtime paraneter allowing user to choose an output format (defaults to JPEG)
        self.set_parameter('format', 'JPEG', ['JPEG', 'PNG', 'GIF', 'BMP', 'TIFF', 'EPS']) 

        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #18
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        self.set_parameter('fields', '')

        # we can specify multiple input formats that if matched
        # will be normalized to the output format
        self.set_parameter('in_formats', '%m/%d/%Y|%m/%Y|%Y')
        self.set_parameter('out_format', '%Y-%m-%dT%H:%M:%SZ')

        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        self.set_parameter('fields', '')
        
        # we can specify multiple input formats that if matched
        # will be normalized to the output format
        self.set_parameter('in_formats', '%m/%d/%Y|%m/%Y|%Y')
        self.set_parameter('out_format', '%Y-%m-%dT%H:%M:%SZ')

        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        self.set_parameter("fields", "")

        # we can specify multiple input formats that if matched
        # will be normalized to the output format
        self.set_parameter("in_formats", "%m/%d/%Y|%m/%Y|%Y")
        self.set_parameter("out_format", "%Y-%m-%dT%H:%M:%SZ")

        log.info("Component Initialized: %s" % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)

        # publishers don't have an output port
        self.remove_output('out')

        self.set_parameter('output_dir', 'fastxml')
        self.set_parameter('on_exist', 'Abort',
                           ['Abort', 'Overwrite', 'NextAvaiable'])

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #22
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # publishers don't have an output port
        self.remove_output('out')

        self.set_parameter('output_dir', 'fastxml')
        self.set_parameter('on_exist', 'Abort', ['Abort', 'Overwrite', 
                                                            'NextAvaiable'])

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        Component.__init__(self)

        # remove the defaut outport port since this is a PUBLISHER
        self.remove_output('out')

        # create a runtime parameter for the user to specify an output filename
        self.set_parameter('output directory', '')
        # runtime paraneter allowing user to choose an output format (defaults to JPEG)
        self.set_parameter('format', 'JPEG',
                           ['JPEG', 'PNG', 'GIF', 'BMP', 'TIFF', 'EPS'])

        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #24
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        self.remove_output('out')

        self.set_parameter('host', 'localhost')
        self.set_parameter('port', '2600')
        self.set_parameter('collection', '')

        # cloud9 bulk indexing end point
        self.index_path = '/v1/_bulk/'
        self.headers = {'content-type': 'application/json; charset=utf-8'}

        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        Component.__init__(self)
        
        self.set_parameter('size', '(128, 128)')
        self.set_parameter('filter', 'ANTIALIAS', ['ANTIALIAS', 'NEAREST', 'BILINEAR', 'BICUBIC'])

        self.filter_dict = {
            'ANTIALIAS': Image.ANTIALIAS,
            'NEAREST': Image.NEAREST,
            'BILINEAR': Image.BILINEAR,
            'BICUBIC': Image.BICUBIC
        }

        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # this is a publisher so there is no output
        self.remove_output('out')
        
        self.set_parameter('outfile', 'pypescsvoutput.csv')
        self.set_parameter('fields', '_originals_')

        # used to join multivaled fields
        self.set_parameter('multi_separator', ';')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #27
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # this is a publisher so there is no output
        self.remove_output('out')
        
        self.set_parameter('outfile', 'pypescsvoutput.csv')
        self.set_parameter('fields', '_originals_')

        # used to join multivaled fields
        self.set_parameter('multi_separator', ';')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        Component.__init__(self)

        self.set_parameter('size', '(128, 128)')
        self.set_parameter('filter', 'ANTIALIAS',
                           ['ANTIALIAS', 'NEAREST', 'BILINEAR', 'BICUBIC'])

        self.filter_dict = {
            'ANTIALIAS': Image.ANTIALIAS,
            'NEAREST': Image.NEAREST,
            'BILINEAR': Image.BILINEAR,
            'BICUBIC': Image.BICUBIC
        }

        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #29
0
    def __init__(self):
        Component.__init__(self)

        # define email regular expression string
        emailre = r'((?:[a-zA-Z0-9_\-\.]+)@(?:(?:\[[0-9]{1,3}\.[0-9]{1,3}\.' \
                  r'[0-9]{1,3}\.)|(?:(?:[a-zA-Z0-9\-]+\.)+))(?:[a-zA-Z]{2,4}' \
                  r'|[0-9]{1,3})(?:\]?))'

        # compile the regular expression
        self._reobj = re.compile(emailre)

        # set component parameters
        self.set_parameter('fields', '')
        self.set_parameter('destination', 'emails')

        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #30
0
    def __init__(self):
        Component.__init__(self)

        # define email regular expression string
        emailre = r'((?:[a-zA-Z0-9_\-\.]+)@(?:(?:\[[0-9]{1,3}\.[0-9]{1,3}\.' \
                  r'[0-9]{1,3}\.)|(?:(?:[a-zA-Z0-9\-]+\.)+))(?:[a-zA-Z]{2,4}' \
                  r'|[0-9]{1,3})(?:\]?))'

        # compile the regular expression
        self._reobj = re.compile(emailre)

        # set component parameters
        self.set_parameter('fields', '')
        self.set_parameter('destination', 'emails')

        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #31
0
    def __init__(self):
        # initialize parent class
        Component.__init__(self)
        
        # Optionally add/remove component ports
        # self.remove_output('out')
        # self.add_input('in2', 'A description of what this port is used for')

        # Setup any user parameters required by this component 
        # 2nd arg is the default value, 3rd arg is optional list of choices
        #self.set_parameter('MyParam', 'opt1', ['opt1', 'opt2', 'opt3'])

        self.remove_input('in')
        self.remove_output('out')
        self.add_input('files', '(edu.utah.sci.vistrails.basic:File)')

        self.set_package('edu.utah.sci.vistrails.http')

        # log successful initialization message
        log.info('Component Initialized: %s' % self.__class__.__name__)
    def __init__(self):
        Component.__init__(self)

        # break up regular expression parts so it is easier to read
        cityre = r'(\b(?:[A-Z]+[a-z]+\s*)+\s*\b)+'
        statere = r'(A[LKSZR]|C[AOT]|D[EC]|F[ML]|G[AU]|HI|I[DLNA]|K[SY]|LA|' \
                  r'M[EHDAINSOTP]|N[EVHJMYCD]|O[HKR]|P[WAR]|RI|S[CD]|T[NX]|' \
                  r'UT|V[TIA]|W[AVIY])'
        zipre = r'([0-9]{5}(?:[- /]?[0-9]{4})?)'
        
        # build regular expression to match address using parts above
        # city + optional space(s) + comma + one or more spaces + 
        # state + optional (one or more spaces + zip)
        self._reobj = re.compile(r'%s\s*[,]\s+%s(?:\s+%s)?' % \
                                    (cityre, statere, zipre))

        # set component parameters
        self.set_parameter('fields', '')
        self.set_parameter('destination', 'addresses')

        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #33
0
 def __init__(self):
     # initialize parent class
     Component.__init__(self)
     self.remove_output('out')
     log.info('Component Initialized: %s' % self.__class__.__name__)
 def __init__(self):
     Component.__init__(self)
     self.set_parameter('delete_data', 'False', ['True', 'False'])
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #35
0
 def __init__(self):
     Component.__init__(self)
     self.set_parameter('delete_data', 'False', ['True', 'False'])
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #36
0
 def __init__(self):
     Component.__init__(self)
     
     # create a runtime parameter to specify a degree of rotation
     self.set_parameter('degree', '0')
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #37
0
    def __init__(self):
        Component.__init__(self)

        # Create a runtime parameter allowing a border to be specified
        self.set_parameter('border', '0')
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #38
0
 def __init__(self, fp):
     Component.__init__(self)
     self.fp = fp
Beispiel #39
0
 def __init__(self, pattern):
     Component.__init__(self)
     self.regex = re.compile(pattern)
Beispiel #40
0
 def __init__(self, fp):
     Component.__init__(self)
     self.fp = fp
Beispiel #41
0
 def __init__(self):
     # initialize parent class
     Component.__init__(self)
     self.add_output('out2', 'Second Output Port')
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #42
0
 def __init__(self):
     Component.__init__(self)
     self.add_input('in2', 'Second Input Port')
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #43
0
 def __init__(self, pattern):
     Component.__init__(self)
     self.regex = re.compile(pattern)
Beispiel #44
0
 def __init__(self):
     Component.__init__(self)
     self.set_parameter('fields', '')
     self.set_parameter('operation', 'lowercase',
                        ['lowercase', 'UPPERCASE', 'TitleCase'])
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #45
0
 def __init__(self):
     Component.__init__(self)
Beispiel #46
0
    def __init__(self):
        Component.__init__(self)

        # create a runtime parameter to specify a degree of rotation
        self.set_parameter('degree', '0')
        log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #47
0
 def __init__(self):
     # initialize parent class
     Component.__init__(self)
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #48
0
 def __init__(self):
     # initialize parent class
     Component.__init__(self)
     self.add_output('out2', 'Second Output Port')
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #49
0
 def __init__(self):
     # initialize parent class
     Component.__init__(self)
     self.remove_output('out')
     log.info('Component Initialized: %s' % self.__class__.__name__)
Beispiel #50
0
 def __init__(self, port=40000):
     Component.__init__(self)
     self.set_parameter("port", port)
     self.set_parameter("name", None)