From f6d021cd2c13abbe9dd2e23e364b0337248d3928 Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Tue, 20 Jan 2009 15:53:46 +0000 Subject: Updated function help. --- src/msec/help_draksec.py | 28 ++++++++++++++++++++++++++++ src/msec/libmsec.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/msec/help_draksec.py b/src/msec/help_draksec.py index 48f0df0..da6026c 100755 --- a/src/msec/help_draksec.py +++ b/src/msec/help_draksec.py @@ -13,6 +13,7 @@ from libmsec import MSEC, Log help_perl_file = 'help.pm' help_python_file = 'help.py' +help_wiki_file = 'help.wiki' header_perl = '''package security::help; # !! THIS FILE WAS AUTO-GENERATED BY draksec_help.py !! @@ -41,6 +42,26 @@ HELP = { footer_perl = '''); ''' +header_wiki = '''The following functionality is supported by MSEC: +''' + +footer_wiki = ''' +''' + +header_python = '''# libmsec documentation for python. + +import gettext + +# localization +try: + cat = gettext.Catalog('msec') + _ = cat.gettext +except IOError: + _ = str + +HELP = { +''' + footer_python = '''} ''' @@ -51,8 +72,12 @@ function_str_perl = ''''%s' => N("%s"), function_str_python = ''' '%s': _("%s"), ''' +function_str_wiki = ''';%s: %s +''' + help_perl = open(help_perl_file, "w") help_python = open(help_python_file, "w") +help_wiki = open(help_wiki_file, "w") # process all configuration parameters log = Log(log_syslog=False, log_file=False) @@ -60,6 +85,7 @@ msec = MSEC(log) print >>help_perl, header_perl print >>help_python, header_python +print >>help_wiki, header_wiki for variable in config.SETTINGS: callback, params = config.SETTINGS[variable] @@ -67,8 +93,10 @@ for variable in config.SETTINGS: if func: print >>help_perl, function_str_perl % (variable, func.__doc__.strip()) print >>help_python, function_str_python % (variable, func.__doc__.strip()) + print >>help_wiki, function_str_wiki % (variable, func.__doc__.strip()) print >>help_perl, footer_perl print >>help_python, footer_python +print >>help_wiki, footer_wiki # draksec_help.py ends here diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index c9cc110..89af772 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -1275,7 +1275,7 @@ class MSEC: self.set_zero_one_variable(SYSCTLCONF, 'net.ipv4.conf.all.rp_filter', arg, 'Enabling ip spoofing protection', 'Disabling ip spoofing protection') def enable_dns_spoofing_protection(self, arg, alert=1): - ''' Enable/Disable name resolution spoofing protection. If \\fIalert\\fP is true, also reports to syslog.''' + ''' Enable/Disable name resolution spoofing protection.''' hostconf = self.configfiles.get_config_file(HOSTCONF) val = hostconf.get_match('nospoof\s+on') -- cgit v1.2.1