Skip to content

Commit

Permalink
Merge branch 'release-v1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pombredanne committed Nov 3, 2014
2 parents 1b10a53 + c03b9d0 commit 952f957
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
3 changes: 2 additions & 1 deletion about.ABOUT
@@ -1,7 +1,8 @@
about_resource: .

name: AboutCode
version: 0.9.0
version: 1.0.1


owner: nexB Inc.
author: Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez
Expand Down
7 changes: 2 additions & 5 deletions about_code_tool/about.py
Expand Up @@ -46,7 +46,7 @@
import ntpath


__version__ = '0.9.0'
__version__ = '1.0.1'

# See http://dejacode.org
__about_spec_version__ = '1.0'
Expand Down Expand Up @@ -968,8 +968,6 @@ def get_custom_field_keys(self):
return custom_key

def get_row_data(self, updated_path, custom_keys):
print(updated_path)
print(custom_keys)
"""
Create a csv compatible row of data for this object.
"""
Expand Down Expand Up @@ -1267,7 +1265,6 @@ def generate_attribution(self, template_path=None, limit_to=None):
limit_to = limit_to or []

about_object_fields = []
about_content_dict = {}
license_dict = {}

not_process_components = list(limit_to)
Expand Down Expand Up @@ -1328,7 +1325,7 @@ def generate_attribution(self, template_path=None, limit_to=None):
# However, this is a temp fix for the license summarization feature.
rendered = template.render(about_objects=about_object_fields,
license_keys=license_key,
license_texts = license_text_list,
license_texts=license_text_list,
common_licenses=COMMON_LICENSES)
return rendered

Expand Down
8 changes: 3 additions & 5 deletions about_code_tool/genabout.py
Expand Up @@ -40,7 +40,7 @@

import about

__version__ = '0.9.0'
__version__ = '1.0.1'

__copyright__ = """
Copyright (c) 2013-2014 nexB Inc. All rights reserved.
Expand Down Expand Up @@ -391,8 +391,6 @@ def get_dje_license_list(self, gen_location, input_list, gen_license, dje_licens
# update/overwrite the 'license_text_file' with
# 'dje_license_key'
if line['license_text_file']:
file_value = []
license_file_list = []
file_location = line['about_file']
about_parent_dir = dirname(file_location)
license_text_file = line['license_text_file']
Expand Down Expand Up @@ -544,7 +542,7 @@ def update_about_resource(self, line, about_file_exist):
about_resource = line['about_file']
if about_resource.endswith('/'):
line['about_resource'] = '.'
else: # 'about_resource' key present with no value
else: # 'about_resource' key present with no value
about_resource = line['about_file']
if about_resource.endswith('/'):
line['about_resource'] = '.'
Expand Down Expand Up @@ -701,7 +699,7 @@ def main(parser, options, args):
handler.setLevel(logging.WARNING)

valid_actions = 0, 1, 2, 3
if action:
if action:
if action in valid_actions:
action_num = action
else:
Expand Down
4 changes: 2 additions & 2 deletions about_code_tool/genattrib.py
Expand Up @@ -43,9 +43,9 @@
logger.addHandler(handler)
file_logger = logging.getLogger(__name__ + '_file')

__version__ = '0.9.0'
__version__ = '1.0.1'

__about_spec_version__ = '0.8.0' # See http://dejacode.org
__about_spec_version__ = '1.0.0' # See http://dejacode.org

__copyright__ = """
Copyright (c) 2013-2014 nexB Inc. All rights reserved.
Expand Down
16 changes: 7 additions & 9 deletions about_code_tool/tests/test_about.py
Expand Up @@ -116,7 +116,7 @@ def test_header_row_in_csv_output(self):
'checksum_sha256,dje_component,dje_license,dje_organization,'
'dje_license_name,scm_branch,scm_repository,signature_gpg_file,'
'redistribute_sources,about_format,usage,'
'license_text,notice,' # These two are not supported and thus treat as custom keys
'license_text,notice,' # These two are not supported and thus treat as custom keys
'scm_path,scm_tool,scm_rev,scm_tag,organization,'
'warnings,errors')

Expand Down Expand Up @@ -606,26 +606,24 @@ def test_remove_blank_lines_and_no_colon_fields(self):
self.assertEqual(expected_warnings[i][0], w.code)
self.assertEqual(expected_warnings[i][1], w.field_value)

# FIXME: This is failing because there is no component list provided
def FAILING_test_generate_attribution_with_custom_template(self):
def test_generate_attribution_with_custom_template(self):
expected = (u'notice_text:'
'version:2.4.3'
'about_resource:httpd-2.4.3.tar.gz'
'name:Apache HTTP Serverlicense_text:')
test_file = join(TESTDATA_DIR, 'attrib/attrib.ABOUT')
collector = about.Collector(test_file)
template = join(TESTDATA_DIR, 'attrib/test.template')
result = collector.generate_attribution(template)
result = collector.generate_attribution(template, limit_to=[''])
self.assertEqual(expected, result)

# FIXME: This is failing because there is no component list provided
def FAILING_test_generate_attribution_with_default_template(self):
def test_generate_attribution_with_default_template(self):
f = open(join(TESTDATA_DIR, 'attrib/attrib.html'))
expected = f.read()
test_file = join(TESTDATA_DIR, 'attrib/attrib.ABOUT')
collector = about.Collector(test_file)
result = collector.generate_attribution()
# Strip all the white spaces
result = collector.generate_attribution(limit_to=[''])
# Strip all the white spaces
self.assertEqual(re.sub(r'\s+', '', expected), re.sub(r'\s+', '', result))

def test_license_text_extracted_from_license_text_file(self):
Expand Down Expand Up @@ -698,4 +696,4 @@ def test_get_about_name(self):
def test_get_dje_license_name(self):
about_file = about.AboutFile(join(TESTDATA_DIR, 'basic/simple.about'))
result = about_file.get_dje_license_name()
self.assertEqual(result, 'Apache License 2.0')
self.assertEqual(result, 'Apache License 2.0')
6 changes: 4 additions & 2 deletions docs/CHANGELOG.rst
@@ -1,6 +1,8 @@
Release 1.0.1:
2013-11-03: Minor bug fixes, such as extraneous debug printouts.

Release next:

Release 1.0.0:
2013-10-31: Making 1.0: some changes in the spec, such as supporting only text in external files. Several refinements including common licenses.

Release 0.8.1:
2013-06-24: Initial release with minimal capabilities to read and validate ABOUT files format 0.8.0 and output a CSV inventory.

0 comments on commit 952f957

Please sign in to comment.