本文整理匯總了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