Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
matograine
silkaj
Commits
897dbdd0
Commit
897dbdd0
authored
Jan 30, 2019
by
Moul
Committed by
Mael
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mod] read auth-file: Use pathlib.Path
parent
928ca7e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
silkaj/auth.py
silkaj/auth.py
+4
-4
No files found.
silkaj/auth.py
View file @
897dbdd0
...
...
@@ -18,7 +18,7 @@ along with Silkaj. If not, see <https://www.gnu.org/licenses/>.
from
silkaj.tools
import
message_exit
from
click
import
command
,
option
,
pass_context
from
getpass
import
getpass
from
os
import
p
ath
from
pathlib
import
P
ath
from
re
import
compile
,
search
from
duniterpy.key
import
SigningKey
from
duniterpy.key
import
ScryptParams
...
...
@@ -51,10 +51,10 @@ def generate_auth_file(file):
@
pass_context
def
auth_by_auth_file
(
ctx
):
file
=
ctx
.
obj
[
"AUTH_FILE_PATH"
]
if
not
path
.
isfile
(
file
):
authfile
=
Path
(
file
)
if
not
authfile
.
is_file
():
message_exit
(
'Error: the file "'
+
file
+
'" does not exist'
)
with
open
(
file
)
as
f
:
filetxt
=
f
.
read
()
filetxt
=
authfile
.
open
(
"r"
).
read
()
regex_seed
=
compile
(
"^[0-9a-fA-F]{64}$"
)
regex_gannonce
=
compile
(
"^pub: [1-9A-HJ-NP-Za-km-z]{43,44}
\n
sec: [1-9A-HJ-NP-Za-km-z]{88,90}.*$"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment