本文整理汇总了Python中meresco.core.Observable.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Observable.__init__方法的具体用法?Python Observable.__init__怎么用?Python Observable.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meresco.core.Observable
的用法示例。
在下文中一共展示了Observable.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, host=None, port=None, path=None, name=None, conversion=None):
Observable.__init__(self, name=name)
self._host = host
self._port = port
self._path = '' if path is None else path
self._path += '/__lucene_remote__'
self._conversion = Conversion() if conversion is None else conversion
示例2: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, searchApiBaseUrl='https://api.histograph.io/search', **kwargs):
Observable.__init__(self, **kwargs)
parsedUrl = parseAbsoluteUrl(searchApiBaseUrl)
self._host = parsedUrl.host
self._port = parsedUrl.port
self._path = parsedUrl.path
self._ssl = (parsedUrl.scheme == 'https')
示例3: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, host=None, port=None, core=None):
Observable.__init__(self)
self._host = host
self._port = port
self._core = core
if core is not None:
self.observable_name = lambda: core
示例4: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, reactor, host=None, port=None, period=None, verbose=None, prio=None, name=None, err=None, autoStart=True, schedule=None, retryAfterErrorTime=30, compress=True):
Observable.__init__(self, name=name)
self._reactor = reactor
self._host = host
self._port = port
self._schedule = schedule
if schedule is None:
if period is None:
period = 1
else:
warn("Please use schedule instead of period.", DeprecationWarning) # since 2013-02-20
self._schedule = Schedule(period=period)
elif not period is None:
raise ValueError("Using both schedule and period is invalid")
self._prio = prio
self._err = err or sys.stderr
self._paused = not autoStart
self._currentTimer = None
self._currentProcess = None
self._sok = None
self._errorState = None
self._retryAfterErrorTime = retryAfterErrorTime
self._compress = compress
if autoStart and (not self._host or not self._port):
raise ValueError("Unless autoStart is set to False host and port need to be specified.")
if verbose in [True, False]:
warn('Verbose flag is deprecated', DeprecationWarning)
示例5: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, partName, namespace=None):
Observable.__init__(self)
if not correctNameRe.match(partName):
raise Fields2XmlException('Invalid name: "%s"' % partName)
self._identifier = None
self._partName = partName
self._namespace = namespace
示例6: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, count, field, allowOverrideField=False, maximumCount=None, suggestMode=None):
Observable.__init__(self)
self._count = count
self._field = field
self._suggestMode = suggestMode
self._allowOverrideField = allowOverrideField
self._maximumCount = maximumCount
示例7: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, reactor, conversion=None, **kwargs):
Observable.__init__(self, **kwargs)
self._conversion = Conversion() if conversion is None else conversion
self._dynamicHtml = DynamicHtml([dynamicPath],
reactor=reactor,
notFoundPage='notFound',
additionalGlobals={
'VERSION': version,
'allCoreInfo': self._allCoreInfo,
'parseCql': parseString,
'cqlToExpression': cqlToExpression,
'cql2string': cql2string,
'dumps': dumps,
}
)
self._internalTree = be((Observable(),
(PathFilter('/', excluding=['/static', '/version']),
(self._dynamicHtml,)
),
(PathFilter('/static'),
(PathRename(lambda path: path[len('/static'):]),
(FileServer(staticPath),)
)
),
(PathFilter('/version'),
(StringServer("Meresco Lucene version %s" % version, ContentTypePlainText),)
),
))
示例8: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, name, settings, host=None, port=None, readonly=False, **kwargs):
Observable.__init__(self, name=name)
self._host, self._port = host, port
self.settings = settings
self._fieldRegistry = settings.fieldRegistry
self._name = name
self._readonly = readonly
示例9: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, serviceIdentifier, periodicDownloadName, sourceServiceType, sourceServiceIdentifier=None, pollIntervalConfigSelector=None, name=None, **kwargs):
Observable.__init__(self, name)
self._serviceIdentifier = serviceIdentifier
self._periodicDownloadName = periodicDownloadName
self._pollIntervalConfigSelector = pollIntervalConfigSelector or oaiDownloadConfigSelector
self._sourceServiceType = sourceServiceType
self._sourceServiceIdentifier = sourceServiceIdentifier
self._extraKwargs = kwargs
示例10: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, allowed=None, disallowed=None, **kwargs):
Observable.__init__(self, **kwargs)
if allowed and not disallowed:
self._allowedMessage = lambda message: message in allowed
elif disallowed and not allowed:
self._allowedMessage = lambda message: message not in disallowed
else:
raise ValueError('Use disallowed or allowed')
示例11: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, included=None, excluded=None):
Observable.__init__(self)
if included and excluded or not (included or excluded):
raise ValueError("Use included OR excluded")
if included:
self._allowed = lambda name: name in included
else:
self._allowed = lambda name: not name in excluded
示例12: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, should=None, could=None, namespaces=None, namespaceMap=None):
Observable.__init__(self)
if namespaceMap:
warn("Please use 'namespaces=...'", DeprecationWarning)
namespaces=namespaceMap
self.xpath = _namespaces.copyUpdate(namespaces or {}).xpath
self._should = _init(should)
self._could = _init(could)
示例13: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, title, description, link, antiUnaryClause='', **sruArgs):
Observable.__init__(self)
self._title = title
self._description = description
self._link = link
self._antiUnaryClause = antiUnaryClause
self._sortKeys = sruArgs.get('sortKeys', None)
self._maximumRecords = sruArgs.get('maximumRecords', 10)
示例14: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, home="/", name=None):
Observable.__init__(self, name=name)
self._home = home
self._actions = {
'create': self.handleCreate,
'update': self.handleUpdate,
'delete': self.handleDelete,
}
示例15: __init__
# 需要导入模块: from meresco.core import Observable [as 别名]
# 或者: from meresco.core.Observable import __init__ [as 别名]
def __init__(self, name=None, stderr=stderr, sendRecordData=True, logErrors=True, enableCollectLog=False):
Observable.__init__(self, name=name)
self._stderr = stderr
self._logErrors = logErrors
self._sendRecordData = sendRecordData
self._collectLogForScope = lambda **kwargs: None
if enableCollectLog:
self._collectLogForScope = collectLogForScope