本文整理汇总了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)