當前位置: 首頁>>代碼示例>>Python>>正文


Python Component.__init__方法代碼示例

本文整理匯總了Python中pypes.component.Component.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Component.__init__方法的具體用法?Python Component.__init__怎麽用?Python Component.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pypes.component.Component的用法示例。


在下文中一共展示了Component.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:aashish24,項目名稱:climatepipes1,代碼行數:36,代碼來源:filter.py

示例2: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
 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__)
開發者ID:Big-Data,項目名稱:pypes,代碼行數:9,代碼來源:xmlmappertransformer.py

示例3: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Enucatl,項目名稱:pypes,代碼行數:30,代碼來源:solrpublisher.py

示例4: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:marc-truitt,項目名稱:pypes,代碼行數:30,代碼來源:solrpublisher.py

示例5: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Big-Data,項目名稱:pypes,代碼行數:10,代碼來源:pdfreaderadapter.py

示例6: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Enucatl,項目名稱:pypes,代碼行數:11,代碼來源:dropdocumentfilter.py

示例7: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Big-Data,項目名稱:pypes,代碼行數:11,代碼來源:deletefieldtransformer.py

示例8: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Big-Data,項目名稱:pypes,代碼行數:11,代碼來源:htmladapter.py

示例9: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:marc-truitt,項目名稱:pypes,代碼行數:12,代碼來源:copyfieldtransformer.py

示例10: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Big-Data,項目名稱:pypes,代碼行數:12,代碼來源:renamefieldtransformer.py

示例11: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Enucatl,項目名稱:pypes,代碼行數:12,代碼來源:geocodetransformer.py

示例12: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:fullscale,項目名稱:pypes-imaging,代碼行數:14,代碼來源:imagepublisher.py

示例13: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Big-Data,項目名稱:pypes,代碼行數:14,代碼來源:datenormalizertransformer.py

示例14: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Enucatl,項目名稱:pypes,代碼行數:14,代碼來源:datenormalizertransformer.py

示例15: __init__

# 需要導入模塊: from pypes.component import Component [as 別名]
# 或者: from pypes.component.Component import __init__ [as 別名]
    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__)
開發者ID:Big-Data,項目名稱:pypes,代碼行數:15,代碼來源:fastxmlpublisher.py


注:本文中的pypes.component.Component.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。