Commit f7f307f6 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[pkg] Handle verbose option in setup.py's export function

Make debugging easier.

--HG--
branch : 3.23
parent b5cd8a2cccab
......@@ -118,15 +118,23 @@ def export(from_dir, to_dir,
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 @@ def export(from_dir, to_dir,
continue
if exists(dest):
os.remove(dest)
if verbose:
print('copying %s to %s' % (src, dest))
shutil.copy2(src, dest)
......@@ -153,7 +163,7 @@ class MyInstallLib(install_lib.install_lib):
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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment