[svn] commit: r2263 - /branches/trac127/src/bin/bindctl/bindcmd.py

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jun 24 11:24:06 UTC 2010


Author: zhanglikun
Date: Thu Jun 24 11:24:06 2010
New Revision: 2263

Log:
Fix the bug report by ticket 92: bindctl can't all available modules.

Modified:
    branches/trac127/src/bin/bindctl/bindcmd.py

Modified: branches/trac127/src/bin/bindctl/bindcmd.py
==============================================================================
--- branches/trac127/src/bin/bindctl/bindcmd.py (original)
+++ branches/trac127/src/bin/bindctl/bindcmd.py Thu Jun 24 11:24:06 2010
@@ -113,9 +113,6 @@
             if not self.login_to_cmdctl():
                 return False
 
-            # Get all module information from cmd-ctrld
-            self.config_data = isc.config.UIModuleCCSession(self)
-            self._update_commands()
             self.cmdloop()
         except KeyboardInterrupt:
             return True
@@ -226,7 +223,19 @@
         headers = {"cookie" : self.session_id}
         self.conn.request('POST', url, param, headers)
         return self.conn.getresponse()
-        
+
+    def _update_all_modules_info(self):
+        ''' Get all modules' information from cmdctl, including
+        specification file and configuration data. This function
+        should be called before interpreting command line or complete-key
+        is entered. This may not be the best way to keep bindctl
+        and cmdctl share same modules information, but it works.'''
+        self.config_data = isc.config.UIModuleCCSession(self)
+        self._update_commands()
+
+    def precmd(self, line):
+        self._update_all_modules_info()
+        return line 
 
     def postcmd(self, stop, line):
         '''Update the prompt after every command'''
@@ -371,6 +380,7 @@
 
     def complete(self, text, state):
         if 0 == state:
+            self._update_all_modules_info()
             text = text.strip()
             hints = []
             cur_line = my_readline()




More information about the bind10-changes mailing list