Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Commits
e7d2fe1a
Commit
e7d2fe1a
authored
6 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
[enh]
#91
fix pylint alerts in key.ascii_armor module
parent
8b2344f2
No related branches found
No related tags found
1 merge request
!65
Pylint
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
duniterpy/key/ascii_armor.py
+7
-10
7 additions, 10 deletions
duniterpy/key/ascii_armor.py
with
7 additions
and
10 deletions
duniterpy/key/ascii_armor.py
+
7
−
10
View file @
e7d2fe1a
import
base64
import
base64
import
libnacl
import
libnacl
from
re
import
compil
e
import
r
e
from
typing
import
Optional
,
List
,
Dict
,
Any
from
typing
import
Optional
,
List
,
Dict
,
Any
from
duniterpy.key
import
SigningKey
,
PublicKey
,
VerifyingKey
from
duniterpy.key
import
SigningKey
,
PublicKey
,
VerifyingKey
...
@@ -28,7 +28,6 @@ class MissingPublickeyAndSigningKeyException(Exception):
...
@@ -28,7 +28,6 @@ class MissingPublickeyAndSigningKeyException(Exception):
"""
"""
Raise when the message created is not encrypted and not signed...
Raise when the message created is not encrypted and not signed...
"""
"""
pass
# Custom exceptions
# Custom exceptions
...
@@ -36,7 +35,6 @@ class ParserMissingSigningKeyException(Exception):
...
@@ -36,7 +35,6 @@ class ParserMissingSigningKeyException(Exception):
"""
"""
Raise when the message is encrypted but no SigningKey instance is provided
Raise when the message is encrypted but no SigningKey instance is provided
"""
"""
pass
# Custom exceptions
# Custom exceptions
...
@@ -44,7 +42,6 @@ class ParserMissingPublicKeysException(Exception):
...
@@ -44,7 +42,6 @@ class ParserMissingPublicKeysException(Exception):
"""
"""
Raise when there is at least one signature but no public keys are provided
Raise when there is at least one signature but no public keys are provided
"""
"""
pass
# Exception messages listed here
# Exception messages listed here
...
@@ -170,7 +167,7 @@ class AsciiArmor:
...
@@ -170,7 +167,7 @@ class AsciiArmor:
:return:
:return:
"""
"""
text
=
str
()
text
=
str
()
regex_dash_escape_prefix
=
compile
(
'
^
'
+
DASH_ESCAPE_PREFIX
)
regex_dash_escape_prefix
=
re
.
compile
(
'
^
'
+
DASH_ESCAPE_PREFIX
)
# if prefixed by a dash escape prefix...
# if prefixed by a dash escape prefix...
if
regex_dash_escape_prefix
.
match
(
dash_escaped_line
):
if
regex_dash_escape_prefix
.
match
(
dash_escaped_line
):
# remove dash '-' (0x2D) and space ' ' (0x20) prefix
# remove dash '-' (0x2D) and space ' ' (0x20) prefix
...
@@ -257,11 +254,11 @@ class AsciiArmor:
...
@@ -257,11 +254,11 @@ class AsciiArmor:
:return:
:return:
"""
"""
# regex patterns
# regex patterns
regex_begin_message
=
compile
(
BEGIN_MESSAGE_HEADER
)
regex_begin_message
=
re
.
compile
(
BEGIN_MESSAGE_HEADER
)
regex_end_message
=
compile
(
END_MESSAGE_HEADER
)
regex_end_message
=
re
.
compile
(
END_MESSAGE_HEADER
)
regex_begin_signature
=
compile
(
BEGIN_SIGNATURE_HEADER
)
regex_begin_signature
=
re
.
compile
(
BEGIN_SIGNATURE_HEADER
)
regex_end_signature
=
compile
(
END_SIGNATURE_HEADER
)
regex_end_signature
=
re
.
compile
(
END_SIGNATURE_HEADER
)
regex_fields
=
compile
(
"
^(Version|Comment): (.+)$
"
)
regex_fields
=
re
.
compile
(
"
^(Version|Comment): (.+)$
"
)
# trim message to get rid of empty lines
# trim message to get rid of empty lines
ascii_armor_message
=
ascii_armor_message
.
strip
(
"
\t\n\r
"
)
ascii_armor_message
=
ascii_armor_message
.
strip
(
"
\t\n\r
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment