aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-07-30 18:47:24 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-07-30 18:47:24 +0000
commitcc61e8da8d9a8eaa160f81a2cb992664e93bf0db (patch)
treea475659972d76a6f95f2de0255ad2700b76124f9 /share
parentcdb6fdedf8ef6db733bce24dd1579bac9540df95 (diff)
downloadmsec-cc61e8da8d9a8eaa160f81a2cb992664e93bf0db.tar
msec-cc61e8da8d9a8eaa160f81a2cb992664e93bf0db.tar.gz
msec-cc61e8da8d9a8eaa160f81a2cb992664e93bf0db.tar.bz2
msec-cc61e8da8d9a8eaa160f81a2cb992664e93bf0db.tar.xz
msec-cc61e8da8d9a8eaa160f81a2cb992664e93bf0db.zip
added print_changes and get_translation
Diffstat (limited to 'share')
-rwxr-xr-xshare/shadow.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/share/shadow.py b/share/shadow.py
index e5365d7..29e6341 100755
--- a/share/shadow.py
+++ b/share/shadow.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
#---------------------------------------------------------------
# Project : Mandrake Linux
-# Module : share
+# Module : msec/share
# File : shadow.py
# Version : $Id$
# Author : Frederic Lepied
@@ -53,6 +53,31 @@ def commit_changes():
if len(f[1]) >= 1 and f[1][0] != -1:
apply(f[0], f[1])
+def print_changes():
+ import sys
+ for f in FAKE.values():
+ l = len(f[1])
+ if l >= 1 and f[1][0] != -1:
+ name = f[0].__name__
+ try:
+ if f[0].one_arg:
+ l = 1
+ except AttributeError:
+ pass
+ if l == 1:
+ print name, get_translation(f[0], f[1][0])
+ else:
+ sys.stdout.write(name)
+ for a in f[1]:
+ sys.stdout.write(' ' + str(a))
+ sys.stdout.write('\\n')
+
+def get_translation(func, value):
+ try:
+ return func.arg_trans[value]
+ except (KeyError, AttributeError):
+ return value
+
"""
### code