13
13
from functools import total_ordering
14
14
import sys
15
15
16
- def get_renamer (filename ):
17
- layout = load (filename )
16
+ def get_renamer (filename , logger ):
17
+ layout = load (filename , logger )
18
18
def rename (path ):
19
19
renamed = layout .artificial_path (path )
20
20
return path if renamed is None else renamed
21
21
return rename
22
22
23
- def load (filename ):
23
+ def load (filename , logger ):
24
24
"""Load a project-layout file from 'filename'."""
25
25
with open (filename , 'rb' ) as f :
26
26
content = f .read ().decode ('utf-8' )
27
27
lines = [ line .strip () for line in content .split ('\n ' ) ]
28
- return ProjectLayout (lines )
28
+ return ProjectLayout (lines , logger )
29
29
30
30
def _escape_string_literal_for_regexp (literal , preserve ):
31
31
ESCAPE = u"(){}[].^$+\\ *?"
@@ -53,7 +53,7 @@ class ProjectLayout(object):
53
53
i.e. one or more paths (to include) and zero or more paths
54
54
prefixed by minus-signs (to exclude)."""
55
55
56
- def __init__ (self , lines ):
56
+ def __init__ (self , lines , logger ):
57
57
"""Construct a project-layout object from an array of strings, each
58
58
corresponding to one line of the project-layout. This constructor is
59
59
for testing. Usually, use the 'load' function."""
@@ -71,6 +71,7 @@ def __init__(self, lines):
71
71
num = 0
72
72
for line in lines :
73
73
num += 1
74
+ logger .info ("Line %d: %s" , num , line )
74
75
if not line :
75
76
continue
76
77
if line [0 ] == u'@' :
0 commit comments