当前位置: 首页>>代码示例>>Python>>正文


Python Rule.__init__方法代码示例

本文整理汇总了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]
开发者ID:constanze,项目名称:rulegen,代码行数:11,代码来源:portscanRule.py

示例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)
开发者ID:nicholascar,项目名称:rules_ga_ogcws,代码行数:50,代码来源:ruleset_ga_ws_pub_stds.py


注:本文中的rule.Rule.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。