Skip to content

Commit 237569d

Browse files
committed
Format code and streamline license headers
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 68a2b7d commit 237569d

14 files changed

Lines changed: 499 additions & 607 deletions

NOTICE

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
#
2-
# Copyright (c) nexB Inc. and others.
3-
# SPDX-License-Identifier: Apache-2.0
4-
#
5-
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
63
# ScanCode is a trademark of nexB Inc.
7-
#
8-
# Licensed under the Apache License, Version 2.0 (the "License");
9-
# you may not use this file except in compliance with the License.
10-
# You may obtain a copy of the License at
11-
#
12-
# http://www.apache.org/licenses/LICENSE-2.0
13-
#
14-
# Unless required by applicable law or agreed to in writing, software
15-
# distributed under the License is distributed on an "AS IS" BASIS,
16-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
# See the License for the specific language governing permissions and
18-
# limitations under the License.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/typecode for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
198
#

src/typecode/contenttype.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
#
2-
# Copyright (c) nexB Inc. and others.
3-
# SPDX-License-Identifier: Apache-2.0
4-
#
5-
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
63
# ScanCode is a trademark of nexB Inc.
7-
#
8-
# Licensed under the Apache License, Version 2.0 (the "License");
9-
# you may not use this file except in compliance with the License.
10-
# You may obtain a copy of the License at
11-
#
12-
# http://www.apache.org/licenses/LICENSE-2.0
13-
#
14-
# Unless required by applicable law or agreed to in writing, software
15-
# distributed under the License is distributed on an "AS IS" BASIS,
16-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
# See the License for the specific language governing permissions and
18-
# limitations under the License.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/typecode for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
198
#
209

2110
import contextlib

src/typecode/entropy.py

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
#
2-
# Copyright (c) nexB Inc. and others.
3-
# SPDX-License-Identifier: Apache-2.0
4-
#
5-
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
63
# ScanCode is a trademark of nexB Inc.
7-
#
8-
# Licensed under the Apache License, Version 2.0 (the "License");
9-
# you may not use this file except in compliance with the License.
10-
# You may obtain a copy of the License at
11-
#
12-
# http://www.apache.org/licenses/LICENSE-2.0
13-
#
14-
# Unless required by applicable law or agreed to in writing, software
15-
# distributed under the License is distributed on an "AS IS" BASIS,
16-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
# See the License for the specific language governing permissions and
18-
# limitations under the License.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/typecode for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
198
#
209

2110
from collections import Counter

src/typecode/extractible.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
#
2-
# Copyright (c) nexB Inc. and others.
3-
# SPDX-License-Identifier: Apache-2.0
4-
#
5-
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
63
# ScanCode is a trademark of nexB Inc.
7-
#
8-
# Licensed under the Apache License, Version 2.0 (the "License");
9-
# you may not use this file except in compliance with the License.
10-
# You may obtain a copy of the License at
11-
#
12-
# http://www.apache.org/licenses/LICENSE-2.0
13-
#
14-
# Unless required by applicable law or agreed to in writing, software
15-
# distributed under the License is distributed on an "AS IS" BASIS,
16-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
# See the License for the specific language governing permissions and
18-
# limitations under the License.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/typecode for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
198
#
209

2110
from functools import partial
@@ -25,7 +14,6 @@
2514
import tarfile
2615
import zipfile
2716

28-
2917
"""
3018
Utilities to detect is a file is extractible. We prefer using extractcode
3119
support if available, otherwise we use the standard library archive

src/typecode/magic2.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
#
2-
# Copyright (c) nexB Inc. and others.
3-
# SPDX-License-Identifier: Apache-2.0 AND MIT
4-
#
5-
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
2+
# Copyright (c) nexB Inc. and others. All rights reserved.
63
# ScanCode is a trademark of nexB Inc.
7-
#
8-
# Licensed under the Apache License, Version 2.0 (the "License");
9-
# you may not use this file except in compliance with the License.
10-
# You may obtain a copy of the License at
11-
#
12-
# http://www.apache.org/licenses/LICENSE-2.0
13-
#
14-
# Unless required by applicable law or agreed to in writing, software
15-
# distributed under the License is distributed on an "AS IS" BASIS,
16-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
# See the License for the specific language governing permissions and
18-
# limitations under the License.
19-
#
4+
# SPDX-License-Identifier: Apache-2.0 AND MIT
5+
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+
# See https://github.com/nexB/typecode for support or download.
7+
# See https://aboutcode.org for more information about nexB OSS projects.
208
#
219
# This code was in part derived from the python-magic library:
22-
# The MIT License (MIT)
23-
#
10+
2411
# Copyright (c) 2001-2014 Adam Hupp
2512
#
2613
# Permission is hereby granted, free of charge, to any person obtaining a copy

src/typecode/mimetypes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#
2+
# Copyright (c) Copyright (c) Python Software Foundation. All rights reserved.
3+
# SPDX-License-Identifier: Python-2.0
4+
# See https://github.com/nexB/typecode for support or download.
5+
# See https://aboutcode.org for more information about nexB OSS projects.
6+
#
7+
18
"""
29
Guess the MIME type of a file extension.
310
download_url: https://github.com/python/cpython/blob/v3.9.1/Lib/mimetypes.py

src/typecode/pygments_lexers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# -*- coding: utf-8 -*-
2+
3+
# SPDX-License-Identifier: BSD-2-Clause
4+
# Copyright (c) Pygments authors
5+
26
"""
37
pygments.lexers
48
~~~~~~~~~~~~~~~
@@ -283,6 +287,7 @@ def type_sort(t):
283287
# - priority
284288
# - last resort: class name
285289
return (t[0], primary[t[1]], t[1].priority, t[1].__name__)
290+
286291
result.sort(key=type_sort)
287292

288293
return result[-1][1](**options)

0 commit comments

Comments
 (0)