summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2007-09-11 13:59:19 +0000
committerWill Thompson <will@willthompson.co.uk>2007-09-11 13:59:19 +0000
commit7eb8466484043dea127c168f41027aea9ff7679d (patch)
treec8319eabe6e2045eea61450ec0fe8e0f787495ff
parentbf69962ab7cb730c270ba31508af8af270c912a6 (diff)
Include default values in generated .manager files
-rw-r--r--examples/generate-manager-file.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/generate-manager-file.py b/examples/generate-manager-file.py
index 02ce6e4..60bb736 100644
--- a/examples/generate-manager-file.py
+++ b/examples/generate-manager-file.py
@@ -23,6 +23,7 @@ print
protocols = manager.ListProtocols()
protocols.sort()
for protocol in protocols:
+ defaults = []
print "[Protocol %s]" % protocol
for param in manager.GetParameters(protocol):
(name, flags, type, default) = param
@@ -33,4 +34,17 @@ for protocol in protocols:
if flags & CONN_MGR_PARAM_FLAG_REGISTER:
print "register",
print
+
+ if default != "": # FIXME: is there a better way to check if a default
+ # exists?
+ defaults.append( (name, type, default) )
+ for default in defaults:
+ if default[1] == "b":
+ if default[2]:
+ value = "true"
+ else:
+ value = "false"
+ else:
+ value = str(default[2])
+ print "default-%s=%s" % (default[0], value)
print