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


Python Rule.RulePlugin类代码示例

本文整理汇总了Python中Rule.RulePlugin的典型用法代码示例。如果您正苦于以下问题:Python RulePlugin类的具体用法?Python RulePlugin怎么用?Python RulePlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RulePlugin类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        self.vsrv_num = kwargs.pop('vsrv_num', '')

        if key.startswith('tmp'):
            return self.GUI_new()
        return self.GUI_mod()
开发者ID:304471720,项目名称:webserver,代码行数:7,代码来源:url_arg.py

示例2: __init__

    def __init__ (self, key, title, extension, note, name_desc, validation_fn=None, **kwargs):
        RulePlugin.__init__ (self, key)

        self.extension = extension
        self.name_desc = name_desc

        url_apply = URL_APPLY %(extension)
        props     = ({},{'class': 'noauto'})[key.startswith('tmp')]

        table = CTK.PropsTable()
        table.Add (title, CTK.TextCfg('%s!%s'%(key, extension), False, props), note)

        submit = CTK.Submitter (url_apply)
        submit += CTK.Hidden ('key', key)
        submit += CTK.Hidden ('vsrv_num', kwargs.pop('vsrv_num', ''))
        submit += table
        self += submit

        # Build validation
        if validation_fn:
            validation = [('tmp!%s'%(extension),                            validation_fn),
                          ('vserver![\d]+!rule![\d]+!match!%s'%(extension), validation_fn)]
        else:
            validation = []

        # Public URL
        CTK.publish (url_apply, apply, method="POST", validation=validation, extension=extension)
开发者ID:mdavid,项目名称:cherokee-webserver-svnclone,代码行数:27,代码来源:RuleSimple.py

示例3: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        vsrv_num = kwargs.pop('vsrv_num', '')

        submit = CTK.Submitter (URL_APPLY)
        submit += CTK.Hidden ('key',      key)
        submit += CTK.Hidden ('vsrv_num', vsrv_num)
        self += submit
开发者ID:nuxleus,项目名称:cherokee-webserver,代码行数:8,代码来源:tls.py

示例4: __init__

    def __init__(self, key, **kwargs):
        RulePlugin.__init__(self, key)
        vsrv_num = kwargs.pop("vsrv_num", "")

        submit = CTK.Submitter(URL_APPLY)
        submit += CTK.Hidden("key", key)
        submit += CTK.Hidden("vsrv_num", vsrv_num)
        self += submit
开发者ID:nickyhajal,项目名称:webserver,代码行数:8,代码来源:tls.py

示例5: __init__

    def __init__(self, key, **kwargs):
        RulePlugin.__init__(self, key)
        is_new = key.startswith("tmp")
        idx = [1, 0][is_new]

        table = CTK.PropsTable()
        table.Add(_("Method"), CTK.ComboCfg("%s!method" % (key), METHODS[idx:]), _(NOTE_METHOD))

        submit = CTK.Submitter(URL_APPLY)
        submit += CTK.Hidden("key", key)
        submit += CTK.Hidden("vsrv_num", kwargs.pop("vsrv_num", ""))
        submit += table
        self += submit
开发者ID:tml,项目名称:cherokee-webserver-svnclone,代码行数:13,代码来源:method.py

示例6: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        self.vsrv_num = kwargs.pop('vsrv_num', '')

        # Validation, and Public URLs
        VAL = [('^%s!from$'%(key),   validations.is_ip_or_netmask),
               ('^%s!from!.+'%(key), validations.is_ip_or_netmask)]

        CTK.publish ("^%s"%(URL_APPLY), commit, validation=VAL, method="POST")

        if key.startswith('tmp'):
            return self.GUI_new()

        return self.GUI_mod()
开发者ID:Daniel15,项目名称:webserver,代码行数:14,代码来源:from.py

示例7: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        is_new = key.startswith('tmp')
        props  = ({},{'class': 'noauto'})[is_new]

        type_widget  = CTK.ComboCfg ('%s!type'%(key), TYPES, props)
        type_val     = CTK.cfg.get_val ('%s!type'%(key), 'regex')
        complete_val = int (CTK.cfg.get_val ('%s!complete'%(key), '0'))

        complete = CTK.CheckCfgText ('%s!complete'%(key), False, _('Full header'), props)

        table = CTK.PropsTable()
        table.Add (_("Complete Header"), complete, _(NOTE_COMPLETE))

        if is_new or not complete_val:
            table.Add (_('Header'), CTK.ComboCfg('%s!header'%(key), HEADERS, props), _(NOTE_HEADER))

        if is_new or not complete_val:
            table.Add (_('Type'), type_widget, _(NOTE_TYPES))

        if is_new or type_val == 'regex' or complete_val:
            table.Add (_('Regular Expression'), CTK.TextCfg('%s!match'%(key), False, props), _(NOTE_MATCH))

        if is_new:
            type_widget.bind ('change',
                  """if ($('#%(type_widget)s').val() == 'regex') {
                           $('#%(regex)s').show();
                     } else {
                           $('#%(regex)s').hide();
                  }""" %({'type_widget': type_widget.id, 'regex': table[2].id}))

            complete.bind ('change',
                  """if (! $('#%(complete)s :checkbox')[0].checked) {
                           $('#%(row1)s').show();
                           $('#%(row2)s').show();
                     } else {
                           $('#%(row1)s').hide();
                           $('#%(row2)s').hide();
                  }""" %({'complete': complete.id, 'row1': table[1].id, 'row2': table[2].id}))

        submit = CTK.Submitter (URL_APPLY)
        submit += CTK.Hidden ('key', key)
        submit += CTK.Hidden ('vsrv_num', kwargs.pop('vsrv_num', ''))
        submit += table
        self += submit

        # Validation, and Public URLs
        CTK.publish ("^%s"%(URL_APPLY), commit, method="POST")
开发者ID:BeQ,项目名称:webserver,代码行数:48,代码来源:header.py

示例8: __init__

    def __init__(self, key, **kwargs):
        RulePlugin.__init__(self, key)
        props = ({}, {"class": "noauto"})[key.startswith("tmp")]

        table = CTK.PropsTable()
        table.Add(_("Header"), CTK.ComboCfg("%s!header" % (key), HEADERS, props), _(NOTE_HEADER))
        table.Add(_("Regular Expression"), CTK.TextCfg("%s!match" % (key), False, props), _(NOTE_MATCH))

        submit = CTK.Submitter(URL_APPLY)
        submit += CTK.Hidden("key", key)
        submit += CTK.Hidden("vsrv_num", kwargs.pop("vsrv_num", ""))
        submit += table
        self += submit

        # Validation, and Public URLs
        CTK.publish(URL_APPLY, apply, method="POST")
开发者ID:tml,项目名称:cherokee-webserver-svnclone,代码行数:16,代码来源:header.py

示例9: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        is_new = key.startswith('tmp')
        idx    = (1,0)[is_new]

        # Set the first method is empty
        if not CTK.cfg.get_val ('%s!method'%(key)):
            CTK.cfg ['%s!method'%(key)] = METHODS[idx:][0][0]

        table = CTK.PropsTable()
        table.Add (_('Method'), CTK.ComboCfg('%s!method'%(key), METHODS[idx:], ({}, {'class': 'noauto'})[is_new]), _(NOTE_METHOD))

        submit = CTK.Submitter (URL_APPLY)
        submit += CTK.Hidden ('key', key)
        submit += CTK.Hidden ('vsrv_num', kwargs.pop('vsrv_num', ''))
        submit += table
        self += submit
开发者ID:304471720,项目名称:webserver,代码行数:17,代码来源:method.py

示例10: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        vsrv_num  = kwargs.pop('vsrv_num', '')
        is_new    = key.startswith('tmp')

        # Build the GUI
        if is_new:
            self._GUI_new (key, vsrv_num)
        else:
            refresh = CTK.Refreshable ({'id': 'plugin_exists'})
            refresh.register (lambda: Modify(key, vsrv_num, refresh).Render())
            self += refresh

        # Validation, and Public URLs
        VALS = [("tmp!exists",      validations.is_list),
                ("%s!exists"%(key), validations.is_list)]

        CTK.publish ("^%s"%(URL_APPLY), commit, validation=VALS, method="POST")
开发者ID:304471720,项目名称:webserver,代码行数:18,代码来源:exists.py

示例11: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        props = ({},{'class': 'noauto'})[key.startswith('tmp')]

        table = CTK.PropsTable()
        table.Add (_('Extensions'), CTK.TextCfg('%s!extensions'%(key), False, props), _(NOTE_EXTENSIONS))

        submit = CTK.Submitter (URL_APPLY)
        submit += CTK.Hidden ('key', key)
        submit += CTK.Hidden ('vsrv_num', kwargs.pop('vsrv_num', ''))
        submit += table
        self += submit

        # Validation, and Public URLs
        VALS = [("tmp!extensions",       validations.is_extension_list),
                ("%s!extensions"%(key),  validations.is_extension_list)]

        CTK.publish (URL_APPLY, apply, validation=VALS, method="POST")
开发者ID:mdavid,项目名称:cherokee-webserver-svnclone,代码行数:18,代码来源:extensions.py

示例12: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        self.vsrv_num = kwargs.pop('vsrv_num', '')
        props = ({},{'class':'noauto'})[key.startswith('tmp')]

        submit = CTK.Submitter (URL_APPLY)
        select_all  = CTK.Button (_('Select all'))
        select_none = CTK.Button (_('Select none'))
        select_all.bind  ('click', CHECKBOX_JS % 'true'  + submit.JS_to_submit())
        select_none.bind ('click', CHECKBOX_JS % 'false' + submit.JS_to_submit())

        # GUI
        submit += select_all
        submit += select_none
        submit += CheckListFlags ('%s!countries'%(self.key), props)
        submit += CTK.Hidden ('key', self.key)
        submit += CTK.Hidden ('vsrv_num', self.vsrv_num)

        self += submit
开发者ID:mdavid,项目名称:cherokee-webserver-svnclone,代码行数:19,代码来源:geoip.py

示例13: __init__

    def __init__ (self, key, **kwargs):
        RulePlugin.__init__ (self, key)
        is_new = key.startswith('tmp')
        props  = ({},{'class': 'noauto'})[is_new]

        op_widget = CTK.ComboCfg ('%s!op'%(key), OPERATORS, props)
        op_val    = CTK.cfg.get_val ('%s!op'%(key), 'regex')

        table = CTK.PropsTable()
        table.Add (_('Property'), CTK.ComboCfg('%s!stat'%(key), STATPROPS, props), _(NOTE_STATPROP))
        table.Add (_('Operator'), op_widget, _(NOTE_OPERATOR))
        table.Add (_('Unix Timestamp'), CTK.TextCfg('%s!time'%(key), False, props), _(NOTE_TIMESTAMP))

        submit = CTK.Submitter (URL_APPLY)
        submit += CTK.Hidden ('key', key)
        submit += CTK.Hidden ('vsrv_num', kwargs.pop('vsrv_num', ''))
        submit += table
        self += submit

        # Validation, and Public URLs
        CTK.publish (URL_APPLY, commit, method="POST")
开发者ID:skinkie,项目名称:webserver,代码行数:21,代码来源:filetime.py


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