本文整理汇总了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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)
示例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__)