Skip to content

Commit 1bf443c

Browse files
committed
package.py - Log skipped items + made uniform some messages
1 parent b8be73f commit 1bf443c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

package.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def write_dirs(self, *base_dirs, prefix=None, timestamp=None):
313313
"""
314314
self._ensure_open()
315315
for base_dir in base_dirs:
316-
self._log.info("adding content of directory '%s'", base_dir)
316+
self._log.info("adding content of directory: %s", base_dir)
317317
for path in emit_dir_content(base_dir):
318318
arcname = os.path.relpath(path, base_dir)
319319
self._write_file(path, prefix, arcname, timestamp)
@@ -338,7 +338,7 @@ def _write_file(self, file_path, prefix=None, name=None, timestamp=None):
338338
arcname = name if name else os.path.basename(file_path)
339339
if prefix:
340340
arcname = os.path.join(prefix, arcname)
341-
self._log.info("adding '%s'", arcname)
341+
self._log.info("adding: %s", arcname)
342342
zinfo = self._make_zinfo_from_file(file_path, arcname)
343343
if timestamp is None:
344344
timestamp = self.timestamp
@@ -516,7 +516,7 @@ def __init__(self, args):
516516
def compile(self, patterns):
517517
rules = []
518518
for p in patterns_list(self._args, patterns):
519-
self._log.debug("pattern '%s'", p)
519+
self._log.debug("filter pattern: %s", p)
520520
if p.startswith('!'):
521521
r = re.compile(p[1:])
522522
rules.append((operator.not_, r))
@@ -555,10 +555,14 @@ def apply(path):
555555
def emit_dir(dpath, opath):
556556
if apply(dpath):
557557
yield opath
558+
else:
559+
self._log.info('skip dir: %s', opath)
558560

559561
def emit_file(fpath, opath):
560562
if apply(fpath):
561563
yield opath
564+
else:
565+
self._log.info('skip file: %s', opath)
562566

563567
if os.path.isfile(path):
564568
name = os.path.basename(path)
@@ -569,12 +573,12 @@ def emit_file(fpath, opath):
569573
else:
570574
for root, dirs, files in os.walk(path):
571575
o, d = norm_path(path, root)
572-
log.info('od: %s %s', o, d)
576+
# log.info('od: %s %s', o, d)
573577
if root != path:
574578
yield from emit_dir(d, o)
575579
for name in files:
576580
o, f = norm_path(path, root, name)
577-
log.info('of: %s %s', o, f)
581+
# log.info('of: %s %s', o, f)
578582
yield from emit_file(f, o)
579583

580584

0 commit comments

Comments
 (0)