|
14 | 14 | # ============================================================================ |
15 | 15 |
|
16 | 16 | """ |
17 | | -AboutCode is a tool to process ABOUT files. ABOUT files are small text files |
18 | | -that document the provenance (aka. the origin and license) of software |
19 | | -components as well as the essential obligation such as attribution/credits and |
20 | | -source code redistribution. See the ABOUT spec at http://dejacode.org. |
21 | | -
|
22 | | -AbouCode reads and validates ABOUT files and collect software components |
23 | | -inventories. |
| 17 | +AboutCode toolkit is a tool to process ABOUT files. ABOUT files are |
| 18 | +small text files that document the provenance (aka. the origin and |
| 19 | +license) of software components as well as the essential obligation |
| 20 | +such as attribution/credits and source code redistribution. See the |
| 21 | +ABOUT spec at http://dejacode.org. |
| 22 | +
|
| 23 | +AboutCode toolkit reads and validates ABOUT files and collect software |
| 24 | +components inventories. |
24 | 25 | """ |
25 | 26 |
|
26 | 27 | from __future__ import absolute_import |
27 | 28 | from __future__ import print_function |
| 29 | +from __future__ import unicode_literals |
28 | 30 |
|
| 31 | +from collections import OrderedDict |
29 | 32 | import codecs |
30 | 33 | import json |
31 | 34 | import os |
32 | 35 | import posixpath |
| 36 | +from posixpath import dirname |
33 | 37 | import re |
| 38 | + |
| 39 | +from license_expression import Licensing |
34 | 40 | import unicodecsv |
35 | | -from collections import OrderedDict |
36 | | -from posixpath import dirname |
37 | 41 |
|
38 | 42 | try: |
39 | 43 | import urllib2 # Python 2 |
|
52 | 56 |
|
53 | 57 | from attributecode import CRITICAL |
54 | 58 | from attributecode import ERROR |
55 | | -from attributecode import Error |
56 | 59 | from attributecode import INFO |
57 | 60 | from attributecode import WARNING |
58 | 61 | from attributecode import api |
| 62 | +from attributecode import Error |
59 | 63 | from attributecode import saneyaml |
60 | 64 | from attributecode import util |
61 | | -from attributecode.util import add_unc, UNC_PREFIX, UNC_PREFIX_POSIX, on_windows, copy_license_notice_files |
62 | | -from license_expression import Licensing |
| 65 | +from attributecode.util import add_unc |
| 66 | +from attributecode.util import copy_license_notice_files |
| 67 | +from attributecode.util import on_windows |
| 68 | +from attributecode.util import UNC_PREFIX |
| 69 | +from attributecode.util import UNC_PREFIX_POSIX |
63 | 70 |
|
64 | 71 |
|
65 | 72 | class Field(object): |
@@ -384,7 +391,7 @@ def _validate(self, *args, **kwargs): |
384 | 391 |
|
385 | 392 | name = self.name |
386 | 393 | # FIXME: This is a temp fix for #286 |
387 | | - # The field in ignore_checking_list is validated in the check_file_field_exist function |
| 394 | + # The field in ignore_checking_list is validated in the check_file_field_exist function |
388 | 395 | ignore_checking_list = [u'license_file', u'notice_file', u'changelog_file'] |
389 | 396 | # mapping of normalized paths to a location or None |
390 | 397 | paths = OrderedDict() |
@@ -648,7 +655,7 @@ def create_fields(self): |
648 | 655 | """ |
649 | 656 | self.fields = OrderedDict([ |
650 | 657 | ('about_resource', ListField(required=True)), |
651 | | - #('about_resource', AboutResourceField(required=True)), |
| 658 | + # ('about_resource', AboutResourceField(required=True)), |
652 | 659 | ('name', SingleLineField(required=True)), |
653 | 660 | ('about_resource_path', AboutResourceField()), |
654 | 661 |
|
@@ -822,7 +829,7 @@ def as_dict(self, with_paths=False, with_absent=True, with_empty=True): |
822 | 829 | # Return an empty 'about_resource_path' if the 'about_resource' |
823 | 830 | # key is not found |
824 | 831 | else: |
825 | | - as_dict[arpa] = '' |
| 832 | + as_dict[arpa] = '' |
826 | 833 |
|
827 | 834 | for field in self.all_fields(with_absent=with_absent, |
828 | 835 | with_empty=with_empty): |
@@ -1211,7 +1218,7 @@ def field_names(abouts, with_paths=True, with_absent=True, with_empty=True): |
1211 | 1218 | fields = [] |
1212 | 1219 | if with_paths: |
1213 | 1220 | fields.append(About.about_file_path_attr) |
1214 | | - #fields.append(About.about_resource_path_attr) |
| 1221 | + # fields.append(About.about_resource_path_attr) |
1215 | 1222 |
|
1216 | 1223 | standard_fields = About().fields.keys() |
1217 | 1224 | if with_absent: |
|
0 commit comments