[pkg] Handle verbose option in setup.py's export function 3.23
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 05 Jul 2016 10:44:05 +0200
branch3.23
changeset 11421 06bcb7e7a69c
parent 11420 b5cd8a2cccab
child 11422 63ac20ef558e
[pkg] Handle verbose option in setup.py's export function Make debugging easier.
setup.py
--- a/setup.py	Tue Jul 05 10:20:33 2016 +0200
+++ b/setup.py	Tue Jul 05 10:44:05 2016 +0200
@@ -118,15 +118,23 @@
         import errno
         if ex.errno != errno.EEXIST:
             raise
+    else:
+        if verbose:
+            print('created %s directory' % to_dir)
     for dirpath, dirnames, filenames in os.walk(from_dir):
         for norecurs in blacklist:
             try:
                 dirnames.remove(norecurs)
             except ValueError:
                 pass
+            else:
+                if verbose:
+                    print('not recursing in %s' % join(dirpath, norecurs))
         for dirname in dirnames:
             dest = join(to_dir, dirname)
             if not exists(dest):
+                if verbose:
+                    print('creating %s directory' % dest)
                 os.mkdir(dest)
         for filename in filenames:
             # don't include binary files
@@ -138,6 +146,8 @@
                 continue
             if exists(dest):
                 os.remove(dest)
+            if verbose:
+                print('copying %s to %s' % (src, dest))
             shutil.copy2(src, dest)
 
 
@@ -153,7 +163,7 @@
         if include_dirs:
             for directory in include_dirs:
                 dest = join(self.install_dir, modname, directory)
-                export(directory, dest, verbose=False)
+                export(directory, dest, verbose=self.verbose)
 
 # write required share/cubicweb/cubes/__init__.py
 class MyInstallData(install_data.install_data):