本文整理汇总了Python中autobahn.asyncio.wamp.ApplicationSession.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ApplicationSession.__init__方法的具体用法?Python ApplicationSession.__init__怎么用?Python ApplicationSession.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autobahn.asyncio.wamp.ApplicationSession
的用法示例。
在下文中一共展示了ApplicationSession.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, config=None):
ApplicationSession.__init__(self, config)
QMainWindow.__init__(self)
self.bla = "hh"
self.the_widget = MainWidget(parent=self)
self.statusBar()
self.main_window_init()
示例2: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, client_type, info_topic, realm_name):
self.info_topic = info_topic
self.client_type = client_type
self.realm_name = realm_name
self.loop = None
cfg = ComponentConfig(self.realm_name, {})
ApplicationSession.__init__(self, cfg)
示例3: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self,realm, user, token, update_handler, ready_cb, close_cb, loop):
ApplicationSession.__init__(self, config=ComponentConfig(realm=realm))
self.user = user
self.token = token
self._on_update = update_handler
self._on_ready = ready_cb
self._on_closed = close_cb
self.loop = loop
示例4: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, x, server_id, database, ignore_development=False, simdata_path='/tmp'):
self.server_id = server_id
self._component = GoSmartSimulationServerComponent(
server_id,
database,
self.publish,
ignore_development=ignore_development,
simdata_path=simdata_path
)
ApplicationSession.__init__(self, x)
示例5: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, config=None):
self.log.info("initializing component: {config}", config=config)
ApplicationSession.__init__(self, config)
# load the client private key (raw format)
try:
self._key = cryptosign.SigningKey.from_raw_key(config.extra[u'key'])
except Exception as e:
self.log.error("could not load client private key: {log_failure}", log_failure=e)
self.leave()
else:
self.log.info("client public key loaded: {}".format(self._key.public_key()))
示例6: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, x, gssa_file, subdirectory, output_files, tmp_transferrer='/tmp', input_files=None, definition_files=None, skip_clean=False, server=None):
ApplicationSession.__init__(self, x)
self._gssa = lxml.etree.parse(gssa_file)
self._definition_files = definition_files
self._input_files = input_files
self._server = server
self._tmp_transferrer = tmp_transferrer
# We tar the definition files into one object for transferring and add
# it to the definition node
if self._definition_files is not None:
self._definition_tmp = tempfile.NamedTemporaryFile(suffix='.tar.gz', dir=self._tmp_transferrer)
definition_tar = tarfile.open(fileobj=self._definition_tmp, mode='w:gz')
for definition_file in self._definition_files:
definition_tar.add(definition_file, os.path.basename(definition_file))
logger.debug("Added [%s]" % os.path.basename(definition_file))
definition_tar.close()
self._definition_tmp.flush()
# Note that this makes the file global readable - we assume the
# parent of the tmp directory is used to control permissions
os.chmod(self._definition_tmp.name, stat.S_IROTH | stat.S_IRGRP | stat.S_IRUSR)
logger.debug("Made temporary tar at %s" % self._definition_tmp.name)
definition_node = self._gssa.find('.//definition')
location_remote = os.path.join('/tmp', 'gssa-transferrer', os.path.basename(self._definition_tmp.name))
definition_node.set('location', location_remote)
# Do the same with the input surfaces
if self._input_files is not None:
self._input_tmp = tempfile.NamedTemporaryFile(suffix='.tar.gz', dir=self._tmp_transferrer)
input_tar = tarfile.open(fileobj=self._input_tmp, mode='w:gz')
for input_file in self._input_files:
input_tar.add(input_file, os.path.basename(input_file))
logger.debug("Added [%s]" % os.path.basename(input_file))
input_tar.close()
self._input_tmp.flush()
# Note that this makes the file global readable - we assume the
# parent of the tmp directory is used to control permissions
os.chmod(self._input_tmp.name, stat.S_IROTH | stat.S_IRGRP | stat.S_IRUSR)
logger.debug("Made temporary tar at %s" % self._input_tmp.name)
input_node = lxml.etree.SubElement(self._gssa.find('.//transferrer'), 'input')
location_remote = os.path.join('/tmp', 'gssa-transferrer', os.path.basename(self._input_tmp.name))
input_node.set('location', location_remote)
# Generate a simulation ID
self._guid = uuid.uuid1()
self._subdirectory = subdirectory
self._output_files = output_files
self._skip_clean = skip_clean
示例7: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, x, responses, action, actor, debug, server=None, **kwargs):
ApplicationSession.__init__(self, x)
self._kwargs = kwargs
self._action = action
self._server = server
self._responses = responses
self._actor = actor
self._actor.set_make_call(self.execute_call)
self._actor.set_log(self.log)
self._apis = {}
if debug:
# Seemingly the start_logging call is insufficient
self.log._set_level('trace')
if server or debug:
logger.info("Targeting server [%s]" % (server))
示例8: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, config):
ApplicationSession.__init__(self, config)
self.count = 0
示例9: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, config=None):
ApplicationSession.__init__(self, config)
print("component created")
self.q = self.config.extra['commqueue']
self.tasks = []
示例10: __init__
# 需要导入模块: from autobahn.asyncio.wamp import ApplicationSession [as 别名]
# 或者: from autobahn.asyncio.wamp.ApplicationSession import __init__ [as 别名]
def __init__(self, config=None):
ApplicationSession.__init__(self, config)
print("component created")