Skip to content

Commit e012185

Browse files
committed
Use toolchain notify for printing when finding dupes
1 parent 9bf2048 commit e012185

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

tools/build_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
452452
# Link Program
453453
res, _ = toolchain.link_program(resources, build_path, name)
454454

455-
resources.detect_duplicates()
455+
resources.detect_duplicates(toolchain)
456456

457457
if report != None:
458458
end = time()

tools/git_hooks/find_duplicates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222

2323
scanned_files = {}
2424

25-
exit(resources.detect_duplicates())
25+
exit(resources.detect_duplicates(toolchain))
2626

tools/toolchains/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,21 @@ def _collect_duplicates(self, dupe_dict, dupe_headers):
133133
res._collect_duplicates(dupe_dict, dupe_headers)
134134
return dupe_dict, dupe_headers
135135

136-
def detect_duplicates(self):
136+
def detect_duplicates(self, toolchain):
137137
count = 0
138138
dupe_dict, dupe_headers = self._collect_duplicates(dict(), dict())
139139
for objname, filenames in dupe_dict.iteritems():
140140
if len(filenames) > 1:
141141
count+=1
142-
print "[ERROR] Object file %s.o is not unique!"\
143-
" It could be made from:" % objname
144-
print columnate(filenames)
142+
toolchain.tool_error(
143+
"Object file %s.o is not unique! It could be made from: %s"\
144+
% (objname, " ".join(filenames)))
145145
for headername, locations in dupe_headers.iteritems():
146146
if len(locations) > 1:
147147
count+=1
148-
print "[ERROR] Header file %s is not unique! It could be:" %\
149-
headername
150-
print columnate(locations)
148+
toolchain.tool_error(
149+
"Header file %s is not unique! It could be: %s" %\
150+
(headername, " ".join(locations)))
151151
return count
152152

153153

0 commit comments

Comments
 (0)