本文整理汇总了Python中kol.database.ItemDatabase.init方法的典型用法代码示例。如果您正苦于以下问题:Python ItemDatabase.init方法的具体用法?Python ItemDatabase.init怎么用?Python ItemDatabase.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kol.database.ItemDatabase
的用法示例。
在下文中一共展示了ItemDatabase.init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init
# 需要导入模块: from kol.database import ItemDatabase [as 别名]
# 或者: from kol.database.ItemDatabase import init [as 别名]
def init(params=None):
global _haltEvent
# Create the event which can be used to halt all bots.
_haltEvent = threading.Event()
# Initialize the databases.
ItemDatabase.init()
SkillDatabase.init()
# Force HTTP requests to timeout after 5 minutes.
socket.setdefaulttimeout(300)
示例2: mergeItems
# 需要导入模块: from kol.database import ItemDatabase [as 别名]
# 或者: from kol.database.ItemDatabase import init [as 别名]
def mergeItems():
ItemDatabase.init()
for i in range(len(_items)):
item = _items[i]
try:
savedItem = ItemDatabase.getItemFromId(item["id"])
for k,v in item.iteritems():
if k != "enchantments" and k != "type":
savedItem[k] = v
if "enchantments" in item and len(item["enchantments"]) > 0:
if "enchantments" not in savedItem:
savedItem["enchantments"] = {}
for k,v in item["enchantments"].iteritems():
savedItem["enchantments"][k] = v
_items[i] = savedItem
except ItemNotFoundError:
r = ItemDescriptionRequest(_session, item["descId"])
itemInfo = r.doRequest()
for k,v in itemInfo.iteritems():
item[k] = v
示例3: mergeItems
# 需要导入模块: from kol.database import ItemDatabase [as 别名]
# 或者: from kol.database.ItemDatabase import init [as 别名]
def mergeItems():
ItemDatabase.init()
for i in range(len(_items)):
item = _items[i]
try:
savedItem = ItemDatabase.getItemFromId(item["id"])
for k,v in item.iteritems():
if k != "enchantments" and k != "type":
savedItem[k] = v
if "enchantments" in item and len(item["enchantments"]) > 0:
if "enchantments" not in savedItem:
savedItem["enchantments"] = {}
for k,v in item["enchantments"].iteritems():
savedItem["enchantments"][k] = v
_items[i] = savedItem
except Error.Error, inst:
if inst.code == Error.ITEM_NOT_FOUND:
r = ItemDescriptionRequest(_session, item["descId"])
itemInfo = r.doRequest()
for k,v in itemInfo.iteritems():
item[k] = v
else:
raise inst
示例4: runTest
# 需要导入模块: from kol.database import ItemDatabase [as 别名]
# 或者: from kol.database.ItemDatabase import init [as 别名]
def runTest(self):
ItemDatabase.init()