Skip to content

Commit 3a44fae

Browse files
committed
Fixed #336 - Add support for author_file field
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 97fad9b commit 3a44fae

File tree

8 files changed

+15
-9
lines changed

8 files changed

+15
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ docs/_build
4444
.ve
4545
*.bak
4646
/.cache/
47-
/.settings/
47+
/.settings/
48+
/tcl/

docs/CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Add support for `checksum_sha256`
77
* `check` command will not counted INFO message as error when `--verbose` is set
88
* Update `track_change` to `track_changes`
9+
* Support `author_file`
910

1011
2018-6-25
1112

src/attributecode/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ def create_fields(self):
697697
('owner_url', UrlField()),
698698
('contact', ListField()),
699699
('author', ListField()),
700+
('author_file', FileTextField()),
700701

701702
('vcs_tool', SingleLineField()),
702703
('vcs_repository', SingleLineField()),

tests/test_model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ def test_About_dumps_does_not_transform_strings_in_lists(self):
614614
owner_url:
615615
contact:
616616
author: Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez
617+
author_file:
617618
vcs_tool: git
618619
vcs_repository: https://github.com/dejacode/about-code-tool.git
619620
vcs_path:
@@ -690,6 +691,7 @@ def test_field_names(self):
690691
'owner_url',
691692
'contact',
692693
'author',
694+
'author_file',
693695
'vcs_tool',
694696
'vcs_repository',
695697
'vcs_path',
@@ -878,6 +880,7 @@ def test_About_as_dict_with_present(self):
878880
expected = {'about_resource': u'.',
879881
'about_resource_path': u'',
880882
'author': u'',
883+
'author_file': u'',
881884
'attribute': u'',
882885
'changelog_file': u'',
883886
'checksum_md5': u'',
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
2-
/about/about.ABOUT,.,.,AboutCode,0.11.0,,AboutCode is a tool to process ABOUT files. An ABOUT file is a file.,http://dejacode.org,,apache-2.0,apache-2.0,,apache-2.0.LICENSE,,Copyright (c) 2013-2014 nexB Inc.,NOTICE,,,,,,,nexB Inc.,,,"Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez",git,https://github.com/dejacode/about-code-tool.git,,,,,,,,
1+
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,author_file,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
2+
/about/about.ABOUT,.,.,AboutCode,0.11.0,,AboutCode is a tool to process ABOUT files. An ABOUT file is a file.,http://dejacode.org,,apache-2.0,apache-2.0,,apache-2.0.LICENSE,,Copyright (c) 2013-2014 nexB Inc.,NOTICE,,,,,,,nexB Inc.,,,"Jillian Daguil, Chin Yeung Li, Philippe Ombredanne, Thomas Druez",,git,https://github.com/dejacode/about-code-tool.git,,,,,,,,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
1+
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,author_file,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
22
/about/about_with_about_resource_path.ABOUT,"./apache-2.0.LICENSE
3-
../../complex/about/apache-2.0.LICENSE",apache-2.0.LICENSE,Apache License 2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
3+
../../complex/about/apache-2.0.LICENSE",apache-2.0.LICENSE,Apache License 2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
2-
/about/about.ABOUT,,,AboutCode,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1+
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,author_file,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
2+
/about/about.ABOUT,,,AboutCode,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

tests/testdata/load/expected.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
2-
/load/this.ABOUT,.,.,AboutCode,0.11.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1+
about_file_path,about_resource_path,about_resource,name,version,download_url,description,homepage_url,notes,license,license_expression,license_name,license_file,license_url,copyright,notice_file,notice_url,redistribute,attribute,track_changes,modified,changelog_file,owner,owner_url,contact,author,author_file,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_md5,checksum_sha1,checksum_sha256,spec_version
2+
/load/this.ABOUT,.,.,AboutCode,0.11.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

0 commit comments

Comments
 (0)