From 1e7006ef7338b2069fc432705524311fdd309dca Mon Sep 17 00:00:00 2001 From: Martin Pihlak Date: Tue, 14 Apr 2009 17:00:02 +0300 Subject: [PATCH] Allow quoted queue and consumer names. --- python/newadm.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/python/newadm.py b/python/newadm.py index 01f1e00e..27464596 100755 --- a/python/newadm.py +++ b/python/newadm.py @@ -69,9 +69,9 @@ def unquote_any(self, s): if s: c = s[0] if c == "'": - s = skytools.unquote_literal(c, stdstr = True) + s = skytools.unquote_literal(s, stdstr = True) elif c == '"': - s = skytools.unquote_ident(c) + s = skytools.unquote_ident(s) # extquote? else: s = s.lower() @@ -171,10 +171,22 @@ class DynList(Word): def __init__(self, next, **kwargs): Word.__init__(self, None, next, **kwargs) -class Queue(DynList): +class DynIdentList(DynList): + def get_next(self, typ, word, params): + """Allow quoted queue names""" + next = DynList.get_next(self, typ, word, params) + if next: + params[self.name] = unquote_any(self, word) + return next + +class Queue(DynIdentList): def get_wlist(self): return script.get_queue_list() +class Consumer(DynIdentList): + def get_wlist(self): + return script.get_consumer_list() + class DBNode(DynList): def get_wlist(self): return script.get_node_list() @@ -191,10 +203,6 @@ class User(DynList): def get_wlist(self): return script.get_user_list() -class Consumer(DynList): - def get_wlist(self): - return script.get_consumer_list() - class BatchId(DynList): tk_type = ("num",) def get_wlist(self): -- 2.39.5