Skip to content

Commit b222136

Browse files
committed
Update changelog
Signed-off-by:
2 parents c2cdc71 + 978d153 commit b222136

File tree

396 files changed

+5207
-4700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

396 files changed

+5207
-4700
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ docs/_build
4747
/.cache/
4848
/.settings/
4949
/tcl/
50+
/.python-version
51+
/.tox/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ install:
88
- ./configure etc/conf/dev
99

1010
script:
11-
- bin/py.test -vvs tests
11+
- bin/py.test -vvs
1212

1313
notifications:
1414
irc:

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ or on windows::
6464
configure
6565

6666

67-
USAGE
67+
REFERENCE
6868
-----
69-
See https://github.com/nexB/aboutcode-toolkit/blob/master/USAGE.rst for USAGE.
69+
See https://github.com/nexB/aboutcode-toolkit/blob/master/REFERENCE.rst for reference
70+
on aboutcode-toolkit usage.
7071

7172

7273
TESTS and DEVELOPMENT
@@ -121,4 +122,4 @@ See (of course) the about.ABOUT file for details.
121122
:alt: Windows Master branch tests status
122123
.. |devel-win| image:: https://ci.appveyor.com/api/projects/status/uwj2gh8i9ga1mqwn/branch/develop?png=true
123124
:target: https://ci.appveyor.com/project/nexB/aboutcode-toolkit
124-
:alt: Windows Develop branch tests status
125+
:alt: Windows Develop branch tests status

about.cfg

Lines changed: 0 additions & 35 deletions
This file was deleted.

configure

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ fi
2121

2222
CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2323

24-
python "$CONFIGURE_ROOT_DIR/etc/configure.py" $CFG_CMD_LINE_ARGS
25-
if [ -f "$CONFIGURE_ROOT_DIR/bin/activate" ]; then
26-
source $CONFIGURE_ROOT_DIR/bin/activate
24+
if [[ "$PYTHON_EXE" == "" ]]; then
25+
PYTHON_EXE=python
2726
fi
27+
28+
$PYTHON_EXE "$CONFIGURE_ROOT_DIR/etc/configure.py" $CFG_CMD_LINE_ARGS

docs/CHANGELOG.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
2018-xx-xx
1+
2018-XX-XX
22

3+
Release 3.4.0.pre1
4+
5+
* Support filenames/path with spaces #310
36
* Update ABOUT file format to match the specification
47

58
2018-11-15

etc/scripts/irc-notify.py.ABOUT

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,22 @@ licenses:
1414
url: https://enterprise.dejacode.com/urn/?urn=urn:dje:license:gpl-2.0
1515
notice_file: irc-notify.py.NOTICE
1616
owner: Christopher R. Wood
17+
<<<<<<< HEAD
18+
=======
19+
copyright: Copyright (C) 2015-2016 Christopher R. Wood
20+
license_expression: gpl-2.0-plus
21+
license_text_file: gpl-2.0.LICENSE
22+
notice_text: |
23+
This program is free software; you can redistribute it and/or modify it under the
24+
terms of the GNU General Public License as published by the Free Software
25+
Foundation; either version 2 of the License, or (at your option) any later
26+
version.
27+
28+
This program is distributed in the hope that it will be useful, but WITHOUT ANY
29+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
30+
PARTICULAR PURPOSE. See the GNU General Public License for more details.
31+
32+
You should have received a copy of the GNU General Public License along with this
33+
program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
34+
Fifth Floor, Boston, MA 02110-1301 USA.
35+
>>>>>>> branch 'v3-maintenance' of https://github.com/nexB/aboutcode-toolkit.git

setup.cfg

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,23 @@ release = clean --all sdist --formats=bztar,zip bdist_wheel
1010
[tool:pytest]
1111
norecursedirs =
1212
.git
13+
.cache
14+
.settings
1315
bin
1416
dist
17+
dist
1518
build
1619
_build
17-
dist
18-
local
19-
ci
2020
docs
2121
man
2222
share
23-
samples
24-
.cache
25-
.settings
23+
example
2624
etc
2725
Include
2826
include
2927
Lib
3028
lib
29+
local
3130
Scripts
3231
thirdparty
3332
tmp

setup.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def read(*names, **kwargs):
2424

2525
setup(
2626
name='aboutcode-toolkit',
27-
version='3.3.0',
27+
version='3.4.0.pre1',
2828
license='Apache-2.0',
2929
description=(
3030
'AboutCode-toolkit is a tool to document the provenance (origin and license) of '
@@ -68,9 +68,15 @@ def read(*names, **kwargs):
6868
],
6969
install_requires=[
7070
'jinja2 >= 2.9, < 3.0',
71+
7172
'click >= 6.7, < 7.0',
73+
7274
"backports.csv ; python_version<'3.6'",
73-
'PyYAML >= 3.0, < 4.0',
75+
76+
# required by saneyaml
77+
'PyYAML >= 3.11, <=3.13',
78+
'saneyaml',
79+
7480
'boolean.py >= 3.5, < 4.0',
7581
'license_expression >= 0.94, < 1.0',
7682
],
@@ -79,7 +85,7 @@ def read(*names, **kwargs):
7985
},
8086
entry_points={
8187
'console_scripts': [
82-
'about=attributecode.cmd:cli',
88+
'about=attributecode.cmd:about',
8389
]
8490
},
8591
)

src/attributecode/__init__.py

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@
2020

2121
from collections import namedtuple
2222
import logging
23+
import os
2324

2425
try:
25-
basestring # Python 2
26-
except NameError:
27-
basestring = str # Python 3 #NOQA
26+
# Python 2
27+
unicode # NOQA
28+
except NameError: # pragma: nocover
29+
# Python 3
30+
unicode = str # NOQA
2831

32+
import saneyaml
2933

30-
__version__ = '3.3.0'
31-
34+
__version__ = '3.4.0.pre1'
3235

3336
__about_spec_version__ = '3.1'
3437

@@ -52,39 +55,58 @@ class Error(namedtuple('Error', ['severity', 'message'])):
5255
"""
5356
def __new__(self, severity, message):
5457
if message:
55-
if isinstance(message, basestring):
56-
message = clean_string(message)
58+
if isinstance(message, unicode):
59+
message = self._clean_string(message)
5760
else:
58-
message = clean_string(repr(message))
61+
message = self._clean_string(unicode(repr(message), encoding='utf-8'))
62+
message = message.strip('"')
5963

6064
return super(Error, self).__new__(
6165
Error, severity, message)
6266

6367
def __repr__(self, *args, **kwargs):
64-
sev = severities[self.severity]
65-
msg = clean_string(repr(self.message))
66-
return 'Error(%(sev)s, %(msg)s)' % locals()
68+
sev, msg = self._get_values()
69+
return 'Error(%(sev)s, %(msg)s)' % locals()
6770

71+
def __eq__(self, other):
72+
return repr(self) == repr(other)
6873

69-
def clean_string(s):
70-
"""
71-
Return a cleaned string for `s`, stripping eventual "u" prefixes
72-
from unicode representations.
73-
"""
74-
if not s:
74+
def _get_values(self):
75+
sev = severities[self.severity]
76+
msg = self._clean_string(repr(self.message))
77+
return sev, msg
78+
79+
def render(self):
80+
sev, msg = self._get_values()
81+
return '%(sev)s: %(msg)s' % locals()
82+
83+
def to_dict(self, *args, **kwargs):
84+
"""
85+
Return an ordered dict of self.
86+
"""
87+
return self._asdict()
88+
89+
@staticmethod
90+
def _clean_string(s):
91+
"""
92+
Return a cleaned string for `s`, stripping eventual "u" prefixes
93+
from unicode representations.
94+
"""
95+
if not s:
96+
return s
97+
if s.startswith(('u"', "u'")):
98+
s = s.lstrip('u')
99+
s = s.replace('[u"', '["')
100+
s = s.replace("[u'", "['")
101+
s = s.replace("(u'", "('")
102+
s = s.replace("(u'", "('")
103+
s = s.replace("{u'", "{'")
104+
s = s.replace("{u'", "{'")
105+
s = s.replace(" u'", " '")
106+
s = s.replace(" u'", " '")
107+
s = s.replace("\\\\", "\\")
75108
return s
76-
if s.startswith(('u"', "u'")):
77-
s = s.lstrip('u')
78-
s = s.replace('[u"', '["')
79-
s = s.replace("[u'", "['")
80-
s = s.replace("(u'", "('")
81-
s = s.replace("(u'", "('")
82-
s = s.replace("{u'", "{'")
83-
s = s.replace("{u'", "{'")
84-
s = s.replace(" u'", " '")
85-
s = s.replace(" u'", " '")
86-
s = s.replace("\\\\", "\\")
87-
return s
109+
88110

89111
# modeled after the logging levels
90112
CRITICAL = 50
@@ -96,10 +118,10 @@ def clean_string(s):
96118

97119

98120
severities = {
99-
CRITICAL : u'CRITICAL',
100-
ERROR : u'ERROR',
101-
WARNING : u'WARNING',
102-
INFO : u'INFO',
103-
DEBUG : u'DEBUG',
104-
NOTSET : u'NOTSET'
105-
}
121+
CRITICAL : 'CRITICAL',
122+
ERROR : 'ERROR',
123+
WARNING : 'WARNING',
124+
INFO : 'INFO',
125+
DEBUG : 'DEBUG',
126+
NOTSET : 'NOTSET'
127+
}

0 commit comments

Comments
 (0)