本文整理匯總了Python中rule.Rule.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Rule.__init__方法的具體用法?Python Rule.__init__怎麽用?Python Rule.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rule.Rule
的用法示例。
在下文中一共展示了Rule.__init__方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from rule import Rule [as 別名]
# 或者: from rule.Rule import __init__ [as 別名]
def __init__(self, d, sip, sp, dip, dp, p, i, action, style, ts=None, flag="None"):
Rule.__init__(self, d, sip, sp, dip, dp, p, i, action, style, ts, flag)
self.action = "block"
self.numPortsScanned = len(self.dPorts.elements)
sortedValues = self.dPorts.elements.values()
sortedValues.sort()
self.startPort = sortedValues[0]
self.endPort = sortedValues[self.numPortsScanned-1]
示例2: __init__
# 需要導入模塊: from rule import Rule [as 別名]
# 或者: from rule.Rule import __init__ [as 別名]
def __init__(self, service_get_caps_uri):
#
# Rule details
#
self.rule_id = 'web_service_name'
self.rule_name = 'Web Service Name'
self.rule_business_definition = 'The name is a summarised title (see above) of the service.\n' + \
'The primary purpose of service name is to support machine-to-machine communications.\n' + \
'Where possible, the service name should be meaningful to humans.\n' + \
'The name should be a reflection of the service title (see above), sanitized to be machine readable.\n' + \
'Describes the Service, not the data.\n' + \
'Acronyms are allowed ONLY if they are a widely understood standard or an official name (e.g. DEM).\n' + \
'New service names should be consistent with existing service names.\n' + \
'Must not duplicate an existing GA web service name.\n'
self.rule_authority = 'http://pid-dev.ga.gov.au/organisation/ga'
self.rule_functional_definition = '120 character limit\n' +\
'alphanumeric characters and underscores only\n' +\
'machine-readable reflection of the web service title\n' + \
'acronyms from controlled list only\n' + \
'not a duplicate of existing name'
self.component_name = 'string'
self.passed = True
self.fail_reasons = []
self.components_total_count = 1
self.components_failed_count = 0
self.failed_components = None
#
# Rule code
#
# get the name, from where?
#
# Call the base Rule constructor
#
Rule.__init__(self,
self.rule_id,
self.rule_name,
self.rule_business_definition,
self.rule_authority,
self.rule_functional_definition,
self.component_name,
self.passed,
self.fail_reasons,
self.components_total_count,
self.components_failed_count,
self.failed_components)