• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python component.Component类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pypes.component.Component的典型用法代码示例。如果您正苦于以下问题:Python Component类的具体用法?Python Component怎么用?Python Component使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Component类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    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,代码行数:34,代码来源:filter.py


示例2: __init__

 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,代码行数:7,代码来源:xmlmappertransformer.py


示例3: __init__

    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,代码行数:28,代码来源:solrpublisher.py


示例4: __init__

    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,代码行数:28,代码来源:solrpublisher.py


示例5: __init__

    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,代码行数:8,代码来源:pdfreaderadapter.py


示例6: __init__

    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,代码行数:9,代码来源:dropdocumentfilter.py


示例7: __init__

    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,代码行数:9,代码来源:deletefieldtransformer.py


示例8: __init__

    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,代码行数:9,代码来源:htmladapter.py


示例9: __init__

    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,代码行数:10,代码来源:copyfieldtransformer.py


示例10: __init__

    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,代码行数:10,代码来源:renamefieldtransformer.py


示例11: __init__

    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,代码行数:10,代码来源:geocodetransformer.py


示例12: __init__

    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,代码行数:12,代码来源:imagepublisher.py


示例13: __init__

    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,代码行数:12,代码来源:datenormalizertransformer.py


示例14: __init__

    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,代码行数:12,代码来源:datenormalizertransformer.py


示例15: __init__

    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,代码行数:13,代码来源:fastxmlpublisher.py


示例16: __init__

    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__)
开发者ID:tvillalba,项目名称:pypes-cloud9,代码行数:14,代码来源:cloud9.py


示例17: __init__

    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__)
开发者ID:fullscale,项目名称:pypes-imaging,代码行数:14,代码来源:imagethumbnail.py


示例18: __init__

    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__)
开发者ID:Enucatl,项目名称:pypes,代码行数:15,代码来源:csvwriterpublisher.py


示例19: __init__

    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__)
开发者ID:Enucatl,项目名称:pypes,代码行数:16,代码来源:emailextractor.py


示例20: __init__

    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__)
开发者ID:aashish24,项目名称:climatepipes1,代码行数:20,代码来源:isofillview.py



注:本文中的pypes.component.Component类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pypet.Environment类代码示例发布时间:2022-05-27
下一篇:
Python pyperclip.paste函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap