[svn-commits] espiceland: testsuite/asterisk/trunk r513 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 20 13:41:41 CDT 2010


Author: espiceland
Date: Tue Jul 20 13:41:38 2010
New Revision: 513

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=513
Log:
Add blocking argument to Asterisk.cli_exect() (--russell)

Modified:
    asterisk/trunk/lib/python/asterisk/asterisk.py

Modified: asterisk/trunk/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/asterisk.py?view=diff&rev=513&r1=512&r2=513
==============================================================================
--- asterisk/trunk/lib/python/asterisk/asterisk.py (original)
+++ asterisk/trunk/lib/python/asterisk/asterisk.py Tue Jul 20 13:41:38 2010
@@ -159,11 +159,13 @@
         except IOError:
             print "The destination is not writable '%s'" % target_path
 
-    def cli_exec(self, cli_cmd):
+    def cli_exec(self, cli_cmd, blocking=True):
         """Execute a CLI command on this instance of Asterisk.
 
         Keyword Arguments:
         cli_cmd -- The command to execute.
+        blocking -- When True, do not return from this function until the CLI
+                    command finishes running.  The default is True.
 
         Example Usage:
         asterisk.cli_exec("core set verbose 10")
@@ -172,7 +174,8 @@
                 (os.path.join(self.astetcdir, "asterisk.conf"), cli_cmd)
         print "Executing %s ..." % cmd
         process = subprocess.Popen(cmd, shell=True)
-        process.wait()
+        if blocking:
+            process.wait()
 
     def __gen_ast_conf(self, ast_conf, dir_cat):
         for (var, val) in dir_cat.options:




More information about the svn-commits mailing list