Skip to content

Commit 82bdb8d

Browse files
committed
Removing debug print/tracing
1 parent 10391fe commit 82bdb8d

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

about_code_tool/about.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,12 +1220,10 @@ def generate_attribution(self,
12201220
try:
12211221
template = jinja_env.get_template(template_file_name)
12221222
except j2.TemplateNotFound:
1223-
print('Template: %(template_file_name)s not found' % locals())
12241223
return
12251224

12261225
limit_to = limit_to or []
12271226
limit_to = set(limit_to)
1228-
print('limit_to:', limit_to)
12291227

12301228
about_object_fields = []
12311229
about_content_dict = {}
@@ -1237,52 +1235,43 @@ def generate_attribution(self,
12371235
file_name = about_object.location.partition(self.location)[2]
12381236
# FIXME: a path starting with / is NOT relative
12391237
about_relative_path = '/' + file_name
1240-
print('file_name:', file_name)
12411238

12421239
if limit_to and about_relative_path in limit_to:
12431240
continue
12441241

12451242
about_content = about_object.validated_fields
1246-
print('about_content 1:', about_content)
12471243
# Add information in the dictionary if not in the ABOUT file
12481244
lic_text = unicode(about_object.license_text(),
12491245
errors='replace')
1250-
1251-
print('lic_text:', lic_text)
1246+
12521247
about_content['license_text'] = lic_text
12531248
notice_text = about_object.notice_text()
12541249
about_content['notice_text'] = notice_text
1255-
print('about_content 2:', about_content)
12561250

1257-
# FIXME: The following is a tmp code to handle multiple
1258-
# 'license_text_file' in the input
1251+
# FIXME: The following is temporary code to handle multiple
1252+
# license_text_file paths in the field value, one per lne
12591253
for k in about_content:
12601254
if ('\n' in about_content[k]
12611255
and k == 'license_text_file'):
1256+
# FIXME: we should report decoding errors
12621257
lic_text = unicode(about_object.tmp_get_license_text(),
12631258
errors='replace')
12641259
about_content['license_text'] = lic_text
1265-
print('about_content 3:', about_content)
12661260

1267-
# Raise error if no license_text is found
1261+
# report error if no license_text is found
12681262
if not about_content.get('license_text'):
12691263
msg = ('No license_text found. '
12701264
'Skipping License generation.')
1271-
print()
1272-
print(msg)
1273-
print()
12741265
err = Error(GENATTRIB, 'name',
12751266
about_object.get_about_name(), msg)
12761267
self.genattrib_errors.append(err)
12771268

12781269
about_object_fields.append(about_content)
1279-
print('about_object_fields:', about_object_fields)
12801270

12811271
# find paths requested in the limit_to paths arg that do not point to
12821272
# a corresponding ABOUT file
12831273
for path in limit_to:
12841274
path = posix_path(path)
1285-
12861275
afp = join(self.location, path)
12871276
msg = ('The requested ABOUT file: %(afp)r does not exist. '
12881277
'No attribution generated for this file.' % locals())
@@ -1296,9 +1285,6 @@ def generate_attribution(self,
12961285
license_text_list.append(common_license_dict[key])"""
12971286

12981287
rendered = template.render(about_objects=about_object_fields)
1299-
print('genattrib_errors:', self.genattrib_errors)
1300-
print('rendered:', rendered)
1301-
print()
13021288
return rendered
13031289

13041290
def check_paths(self, paths):

about_code_tool/tests/test_about.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ def test_validate_optional_file_field_value(self):
384384

385385

386386
class UrlCheckTest(unittest.TestCase):
387+
# FIXME: we should use a mock HTTP server AND NEVER do live HTTP requests
387388
def test_check_url__with_network(self):
388389
about_file = about.AboutFile()
389390
self.assertTrue(about_file.check_url('http://www.google.com', True))
@@ -554,11 +555,7 @@ def test_generate_attribution(self):
554555
expected = (u'notice_text:version:2.4.3about_resource:httpd-2.4.3.tar.gz'
555556
'name:Apache HTTP Serverlicense_text:')
556557
collector = about.Collector(join(TESTDATA_DIR, 'attrib/attrib.ABOUT'))
557-
print()
558-
print(collector.abouts[0])
559-
print()
560558
result = collector.generate_attribution(join(TESTDATA_DIR, 'attrib/test.template'))
561-
print('result:', result)
562559
self.assertEqual(expected, result)
563560

564561
def test_license_text_extracted_from_license_text_file(self):

0 commit comments

Comments
 (0)