Skip to content

Commit 5b2cb83

Browse files
committed
Misc fix on code style
1 parent acbfe45 commit 5b2cb83

Some content is hidden

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

57 files changed

+160
-59
lines changed

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# -- Project information -----------------------------------------------------
2020

2121
project = 'python-ndn'
22-
copyright = '2019, Xinyu Ma'
22+
copyright = '2019-2020, The python-ndn authors'
2323
author = 'Xinyu Ma'
2424

2525
# The full version, including alpha/beta/rc tags

docs/src/contribute_support.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Contribute and Support
22
======================
33

44
- Please submit any changes via `GitHub`_ pull requests.
5-
- If you use any existing code, please make sure it is compatible to *LGPL v3*
5+
- If you use any existing code, please make sure it is compatible to *Apache v2*
66
- Ensure that your code complies to `PEP8`_.
77
- Ensure that your code works with *Python 3.6* and *PyPy 7.1.1*.
88
- Please contact the author first if your changes are not back compatible or import new dependencies.

docs/src/installation.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ Setup python3.6 virtual environment with editable installation:
1919
2020
python3.6 -m venv venv
2121
. venv/bin/activate
22-
pip3 install -e .
23-
pip3 install pytest pytest-cov flake8
22+
pip3 install -e .[dev]
2423
2524
Run all tests:
2625

docs/src/schema/schema.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
:mod:`ndn.schema` package
22
============================
33

4+
.. warning::
5+
6+
Name Tree Schema is experimental and capricious.
7+
48
Introduction
59
------------
610

7-
The :mod:`ndn.security` package provides an implementation of CNL application framework.
11+
The :mod:`ndn.security` package provides an implementation of Name Tree Schema.
812

913

1014
CNL Static Namespace Tree

examples/catchunks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

examples/consumer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

examples/nfd_status.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

examples/producer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

examples/putchunks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

examples/rdrnode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

examples/rpc_consumer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

examples/rpc_producer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@
4848
install_requires=requirements,
4949
python_requires=">=3.6",
5050
extras_require={
51-
"dev": ["pytest>=5.3.5", "pytest-cov>=2.8.1"],
51+
"dev": ["pytest>=5.3.5", "pytest-cov>=2.8.1", "flake8>=3.7.9"],
5252
}
5353
)

src/ndn/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/app_support/nfd_mgmt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/app_support/security_v2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/app_support/segment_fetcher.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/client_conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/encoding/name/Component.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/encoding/name/Name.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/encoding/ndn_format_0_3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/encoding/ndnlp_v2.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#
@@ -16,10 +16,9 @@
1616
# limitations under the License.
1717
# -----------------------------------------------------------------------------
1818
from typing import Optional
19-
from .tlv_type import BinaryStr, VarBinaryStr, NonStrictName
19+
from .tlv_type import BinaryStr, VarBinaryStr
2020
from .tlv_var import parse_and_check_tl
21-
from .tlv_model import TlvModel, UintField, BytesField, ModelField, NameField, BoolField
22-
from .ndn_format_0_3 import InterestParam, TypeNumber, Links, Delegation
21+
from .tlv_model import TlvModel, UintField, BytesField, ModelField
2322

2423

2524
__all__ = ['LpTypeNumber', 'NackReason', 'parse_network_nack', 'make_network_nack']

src/ndn/encoding/signer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/encoding/tlv_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/encoding/tlv_type.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/encoding/tlv_var.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/name_tree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/schema/policy.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright (C) 2019-2020 The python-ndn authors
3+
#
4+
# This file is part of python-ndn.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
# -----------------------------------------------------------------------------
118
import abc
219
from typing import Optional
320
from ..encoding import SignaturePtrs, FormalName, InterestParam, BinaryStr

src/ndn/schema/schema_tree.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright (C) 2019-2020 The python-ndn authors
3+
#
4+
# This file is part of python-ndn.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
# -----------------------------------------------------------------------------
118
import asyncio as aio
219
from typing import Dict, Any, Type, Optional
320
from dataclasses import dataclass

src/ndn/schema/simple_cache.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright (C) 2019-2020 The python-ndn authors
3+
#
4+
# This file is part of python-ndn.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
# -----------------------------------------------------------------------------
118
import logging
219
from ..encoding import FormalName, Name, BinaryStr, InterestParam
320
from ..name_tree import NameTrie

src/ndn/schema/simple_node.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright (C) 2019-2020 The python-ndn authors
3+
#
4+
# This file is part of python-ndn.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
# -----------------------------------------------------------------------------
118
# TODO: Change these names
219
from .schema_tree import Node
320
from .util import norm_pattern
@@ -160,4 +177,3 @@ async def provide(self, match, content, **kwargs):
160177
self.timestamp = timestamp()
161178
submatch = match.finer_match(match.name + [Component.from_version(self.timestamp)])
162179
await submatch.provide(content, **kwargs)
163-

src/ndn/schema/simple_trust.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright (C) 2019-2020 The python-ndn authors
3+
#
4+
# This file is part of python-ndn.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
# -----------------------------------------------------------------------------
118
import logging
219
from typing import Callable, Dict, Any
320
from Cryptodome.PublicKey import ECC, RSA

src/ndn/schema/util.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright (C) 2019-2020 The python-ndn authors
3+
#
4+
# This file is part of python-ndn.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
# -----------------------------------------------------------------------------
118
from typing import Union, List, Tuple
2-
from ..encoding import Name, Component, BinaryStr, get_tl_num_size, TypeNumber, write_tl_num
19+
from ..encoding import Name, Component, BinaryStr
320

421
NamePattern = List[Union[BinaryStr, Tuple[int, int, str]]]
522
r"""
@@ -45,4 +62,3 @@ def norm_pattern(name: str) -> NamePattern:
4562
raise ValueError('Pattern variable name cannot be empty')
4663
ret[i] = (0, type_val, content)
4764
return ret
48-

src/ndn/security/keychain/keychain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/security/keychain/keychain_digest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/security/keychain/keychain_sqlite3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/security/osx.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/security/signer/sha256_digest_signer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

src/ndn/security/signer/sha256_ecdsa_signer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -----------------------------------------------------------------------------
2-
# Copyright (C) 2019-2020 Xinyu Ma
2+
# Copyright (C) 2019-2020 The python-ndn authors
33
#
44
# This file is part of python-ndn.
55
#

0 commit comments

Comments
 (0)