diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-03 08:15:17 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-02-03 08:15:17 +0000 |
commit | 8008e87db9a58a828a83688a96ba60fc79b4c048 (patch) | |
tree | 118a9b4d263b5f9957540d7eade939b704edb0b0 | |
parent | 4448b725b2c4ce2a47f704847f3e7be53a9ea3a2 (diff) | |
download | msec-8008e87db9a58a828a83688a96ba60fc79b4c048.tar msec-8008e87db9a58a828a83688a96ba60fc79b4c048.tar.gz msec-8008e87db9a58a828a83688a96ba60fc79b4c048.tar.bz2 msec-8008e87db9a58a828a83688a96ba60fc79b4c048.tar.xz msec-8008e87db9a58a828a83688a96ba60fc79b4c048.zip |
- produce a perl module that pass strict mode checking
- explain perl from where to find translation functions
- "typo fix" to please emacs::php-mode
- cron checking help (aka set_security_conf() help) was not managed the same
way other msec stuff, so let introduce some regexps (python fsck, perl
rulez!)
-rwxr-xr-x | share/draksec_help.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/share/draksec_help.py b/share/draksec_help.py index 02222a3..b25662e 100755 --- a/share/draksec_help.py +++ b/share/draksec_help.py @@ -13,11 +13,14 @@ import sys import imp import inspect +import re header = '''package security::help; # !! THIS FILE WAS AUTO-GENERATED BY draksec_help.py !! -# !! DON'T MODIFY HERE, MODIFY IN THE CVS !! +# !! DO NOT MODIFY HERE, MODIFY IN THE CVS !! +use strict; +use lib qw(/usr/lib/libDrakX); use common; our %help = ( @@ -39,14 +42,24 @@ module = __import__(modulename) sys.stdout.write(header) +clean = re.compile('^.[a-z].*\n', re.M) +clean2 = re.compile('^\n', re.M) +perl = re.compile('^([A-Z_0-9]*) (.*)$', re.M) + for f in inspect.getmembers(module, inspect.isfunction): (args, varargs, varkw, locals) = inspect.getargspec(f[1]) doc = f[1].__doc__ if doc and len(doc) > 2: doc = doc[2:] argspec = inspect.formatargspec(args, varargs, varkw, locals) - s = function_str % (f[0], argspec, doc) - sys.stdout.write(s) + if f[0] == 'set_security_conf': + doc = clean.sub('', doc) + doc = clean2.sub('', doc) + doc = perl.sub('\\1 => N("\\2"),', doc) + sys.stdout.write(doc) + else: + s = function_str % (f[0], argspec, doc) + sys.stdout.write(s) sys.stdout.write(footer) |