[asterisk-commits] pabelanger: testsuite/asterisk/trunk r683 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 2 13:46:08 CDT 2010


Author: pabelanger
Date: Mon Aug  2 13:46:04 2010
New Revision: 683

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=683
Log:
Update install_configs() to only install top-level files, sub-directories
will be ignored.

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=683&r1=682&r2=683
==============================================================================
--- asterisk/trunk/lib/python/asterisk/asterisk.py (original)
+++ asterisk/trunk/lib/python/asterisk/asterisk.py Mon Aug  2 13:46:04 2010
@@ -147,19 +147,16 @@
         used only by this instance can be provided via this API call.
 
         Keyword Arguments:
-        cfg_path -- This argument must be the path to the configuration directory
-        to be installed into this instance of Asterisk.
+        cfg_path -- This argument must be the path to the configuration directory 
+        to be installed into this instance of Asterisk. Only top-level files will
+        be installed, sub directories will be ignored. 
 
         Example Usage:
         asterisk.install_configs("tests/my-cool-test/configs")
         """
-        for dirname, dirnames, filenames in os.walk(cfg_path):
-            blacklist = [ ".svn", "branch-1.4", "branch-1.6.2", "branch-1.8" ]
-            for b in blacklist:
-                if b in dirnames:
-                    dirnames.remove(b)
-            for filename in filenames:
-                target = "%s/%s" % (dirname, filename)
+        for f in os.listdir(cfg_path):
+            target = "%s/%s" % (cfg_path, f)
+            if os.path.isfile(target):
                 self.install_config(target)
 
     def install_config(self, cfg_path):




More information about the asterisk-commits mailing list