本文整理汇总了Python中rules.Rules.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Rules.__init__方法的具体用法?Python Rules.__init__怎么用?Python Rules.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rules.Rules
的用法示例。
在下文中一共展示了Rules.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from rules import Rules [as 别名]
# 或者: from rules.Rules import __init__ [as 别名]
def __init__(self, page, main):
"""Inits the Container and the claim buffers. Gets the item of a page
and check if it exists, and if it is already transffered to Wikidata.
@param page Wikipedia Page object.
@var self.claims Raw claims as extracted.
@var self.merged_claims self.claims merged between the languages.
@var self.validated_claims Merged claims after checks for some
selected propertys.
@var self.new_claims Claims, which where not on Wikidata before and
have no conficts.
@var self.proceed If the item should be extracted.
"""
#create variables
self.lang_claims = []
self.merged_claims = []
self.validated_claims = []
self.new_claims = []
self.proceed = True
self.main = main
#init parents
pywikibot.ItemPage.__init__(self, page.site, page.title())
output.Logger.__init__(self)
Rules.__init__(self)
self.main = main
#get the page
if not self.checkNoItem():
self.proceed = False
else:
self.get()
#check if the item is untransferred
if self.checkTransferred():
self.proceed = False
示例2: __init__
# 需要导入模块: from rules import Rules [as 别名]
# 或者: from rules.Rules import __init__ [as 别名]
def __init__(self):
Board.__init__(self)
Actions.__init__(self)
Rules.__init__(self)
self.players = {}
self.turn = 0
self.game_over = True
示例3: __init__
# 需要导入模块: from rules import Rules [as 别名]
# 或者: from rules.Rules import __init__ [as 别名]
def __init__(self, parent, code, name, params, contents):
Rules.__init__(self, parent=parent, code=code, contents=contents)
self.__name = name
self.__params = list()
for param in params:
param = Param(code=param['code'],
name=param['name'],
value=param['value'],
parent=self)
self.__params.append(param)
示例4: __init__
# 需要导入模块: from rules import Rules [as 别名]
# 或者: from rules.Rules import __init__ [as 别名]
def __init__(self, parent, code, names=None, contents=None):
Rules.__init__(self, parent=parent, code=code, contents=contents)
self.__names = names
示例5: __init__
# 需要导入模块: from rules import Rules [as 别名]
# 或者: from rules.Rules import __init__ [as 别名]
def __init__(self, parent, code, media, contents=None):
Rules.__init__(self, parent=parent, code=code, contents=contents)
self.__media = media