summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4d0f7d8)
raw | patch | inline | side by side (parent: 4d0f7d8)
author | Sven Velt <sven@velt.de> | |
Wed, 13 Jan 2010 22:09:55 +0000 (23:09 +0100) | ||
committer | Sven Velt <sven@velt.de> | |
Wed, 13 Jan 2010 22:09:55 +0000 (23:09 +0100) |
nagixsc.py | patch | blob | history | |
nagixsc_conf2xml.py | patch | blob | history |
diff --git a/nagixsc.py b/nagixsc.py
index d65aa09591406e85d9fbde3c1e79206433e5859b..c5d8712517fda97a9b23ce9b815ab3b1ceb4a41d 100644 (file)
--- a/nagixsc.py
+++ b/nagixsc.py
return ['base64', 'plain',]
+def check_encoding(enc):
+ if enc in available_encodings():
+ return True
+ else:
+ return False
+
+
def decode(data, encoding):
if encoding == 'plain':
return data
diff --git a/nagixsc_conf2xml.py b/nagixsc_conf2xml.py
index 42ebcbcb5b29599055c03a666f9f30c59e39b3b4..a5f3f1374e5f117abd3d075a70fc1d550398eeb3 100755 (executable)
--- a/nagixsc_conf2xml.py
+++ b/nagixsc_conf2xml.py
##############################################################################
-if options.encoding not in available_encodings():
+if not check_encoding(options.encoding):
print 'Wrong encoding method "%s"!' % options.encoding
- print 'Could be one of: %s' % ', '.join(available_encodings)
+ print 'Could be one of: "%s"' % '", "'.join(available_encodings())
sys.exit(127)
##############################################################################