当前位置: 首页>>代码示例>>Python>>正文


Python StorageTools.constructPath方法代码示例

本文整理汇总了Python中yowsup.common.tools.StorageTools.constructPath方法的典型用法代码示例。如果您正苦于以下问题:Python StorageTools.constructPath方法的具体用法?Python StorageTools.constructPath怎么用?Python StorageTools.constructPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yowsup.common.tools.StorageTools的用法示例。


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

示例1: initStore

# 需要导入模块: from yowsup.common.tools import StorageTools [as 别名]
# 或者: from yowsup.common.tools.StorageTools import constructPath [as 别名]
 def initStore(self):
     self.store = LiteAxolotlStore(
         StorageTools.constructPath(
             self.getProp(
                 YowAuthenticationProtocolLayer.PROP_CREDENTIALS)[0],
             self.__class__._DB
         )
     )
     self.state = self.__class__._STATE_HASKEYS if self.store.getLocalRegistrationId() is not None \
         else self.__class__._STATE_INIT
开发者ID:oscardb22,项目名称:yowsup,代码行数:12,代码来源:layer.py

示例2: store

# 需要导入模块: from yowsup.common.tools import StorageTools [as 别名]
# 或者: from yowsup.common.tools.StorageTools import constructPath [as 别名]
 def store(self):
     try:
         if self._store is None:
             self.store = LiteAxolotlStore(
                 StorageTools.constructPath(
                     self.getProp(
                         YowAuthenticationProtocolLayer.PROP_CREDENTIALS)[0],
                     self.__class__._DB
                 )
             )
         return self._store
     except AttributeError:
         return None
开发者ID:Adutchlegend,项目名称:yowsup,代码行数:15,代码来源:layer_base.py

示例3: get_manager

# 需要导入模块: from yowsup.common.tools import StorageTools [as 别名]
# 或者: from yowsup.common.tools.StorageTools import constructPath [as 别名]
 def get_manager(self, username):
     logger.debug("get_manager(username=%s)" % username)
     dbpath = StorageTools.constructPath(username, self.DB)
     store = LiteAxolotlStore(dbpath)
     return AxolotlManager(store, username)
开发者ID:tgalal,项目名称:yowsup,代码行数:7,代码来源:factory.py

示例4: len

# 需要导入模块: from yowsup.common.tools import StorageTools [as 别名]
# 或者: from yowsup.common.tools.StorageTools import constructPath [as 别名]
from yowsup_ext.layers.store import YowStorageLayer

import sys
import logging

logging.basicConfig(level = logging.DEBUG)
logger = logging.getLogger(__name__)

if __name__ == "__main__":
    if len(sys.argv) < 3:
        print("Usage: run.py username password")
        sys.exit(1)
    credentials = (sys.argv[1], sys.argv[2])
    stackBuilder = YowStackBuilder()
    phoneStorage =  StorageTools.getStorageForPhone(credentials[0])
    stackBuilder.setProp(YowStorageLayer.PROP_DB_PATH, StorageTools.constructPath(phoneStorage, "yowstore.db"))
    stack = stackBuilder\
        .pushDefaultLayers(True)\
        .push(YowStorageLayer)\
        .push(YowCleverBotLayer)\
        .build()

    stack.setCredentials(credentials)
    logger.info("Starting")
    stack.broadcastEvent(YowLayerEvent(YowNetworkLayer.EVENT_STATE_CONNECT))

    try:
        stack.loop(timeout = 0.5, discrete = 0.5)
    except AuthError as e:
        print("Auth Error, reason %s" % e)
    except KeyboardInterrupt:
开发者ID:jorgehortelano,项目名称:yowlayer-cleverbot,代码行数:33,代码来源:run.py


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