changeset b212d0803ea6 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=b212d0803ea6
description: Fix for the command argument constraints

diffstat:

 src/command_system/mapping.py |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r d613efae3c96 -r b212d0803ea6 src/command_system/mapping.py
--- a/src/command_system/mapping.py     Thu Oct 08 17:51:49 2009 +0200
+++ b/src/command_system/mapping.py     Fri Oct 09 16:16:59 2009 +0300
@@ -270,6 +270,16 @@
             if value not in initial:
                 raise CommandError("%s: Invalid argument" % key, command)
 
+    # If argument to an option constrained by a sequence was not given - then
+    # it's value should be set to None.
+    for spec_key, spec_value in spec_kwargs:
+        if isinstance(spec_value, (TupleType, ListType)):
+            for key, value in opts:
+                if spec_key == key:
+                    break
+            else:
+                opts.append((spec_key, None))
+
     # We need to encode every keyword argument to a simple string, not the
     # unicode one, because ** expansion does not support it.
     for index, (key, value) in enumerate(opts):
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to