Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autonym
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
putro
autonym
Commits
2aeb05fd
Commit
2aeb05fd
authored
11 years ago
by
putro
Browse files
Options
Downloads
Patches
Plain Diff
added separate updateNym function, and merged deleteNym function in it
parent
f29f81a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
autonym.py
+26
-11
26 additions, 11 deletions
autonym.py
with
26 additions
and
11 deletions
autonym.py
+
26
−
11
View file @
2aeb05fd
...
...
@@ -49,10 +49,11 @@ def menu():
selection
=
raw_input
(
"
Enter
\n\
1 to choose/select active nym
\n\
2 to write a message (as active nym)
\n\
3 to create or update a nym
\n\
4 to delete a nym
\n\
5 to create a new secret key
\n\
6 to delete a secret key
\n\
3 to create a nym
\n\
4 to update a nym (i.e. set new subject...)
\n\
5 to delete a nym
\n\
6 to create a new secret key
\n\
7 to delete a secret key
\n\
q to quit
\n\n\n
"
)
# perform actions based on selection above
...
...
@@ -66,9 +67,12 @@ def menu():
createNym
()
menu
()
elif
selection
==
"
4
"
:
dele
teNym
()
upda
teNym
()
menu
()
elif
selection
==
"
5
"
:
updateNym
(
delete
=
True
)
menu
()
elif
selection
==
"
6
"
:
print
"
\n
secret keys in your keyring:
"
gpgfuncts
.
listSecKeys
()
print
"
\n
"
...
...
@@ -77,14 +81,14 @@ def menu():
gpgfuncts
.
listSecKeys
()
pressKey
()
menu
()
elif
selection
==
"
6
"
:
elif
selection
==
"
7
"
:
sk
=
gpgfuncts
.
defineSecKey
()
fp
=
sk
[
"
fingerprint
"
]
deleteKey
(
fp
)
msg
=
"
key of %s deleted
"
%
sk
[
"
uids
"
][
1
]
config
[
'
last_message
'
]
=
msg
menu
()
elif
selection
==
"
7
"
:
elif
selection
==
"
8
"
:
modifyConfig
()
menu
()
elif
selection
==
"
q
"
:
...
...
@@ -129,8 +133,8 @@ def createNym():
menu
()
sendMixMsg
(
dest
,
emsg
)
def
dele
teNym
():
print
"
Choose nym to delete
"
def
upda
teNym
(
delete
=
False
):
print
"
Choose nym to
update/
delete
:
"
askNym
()
dest
=
"
config@
"
+
anym
.
domain
...
...
@@ -139,7 +143,7 @@ def deleteNym():
menu
()
if
not
gpgfuncts
.
selectKey
(
anym
.
name
):
print
"
no key available
, creating a new one
for %s
"
%
email
print
"
no key available for %s
"
%
anym
.
name
menu
()
if
not
anym
[
'
passphrase
'
]:
...
...
@@ -147,7 +151,18 @@ def deleteNym():
else
:
pwd
=
anym
[
'
passphrase
'
]
msg
=
prepareSetupMsg
(
gpgfuncts
.
selectSecKey
(
anym
.
name
),
"
delete
"
,
"
yes
"
)
if
not
delete
:
subj_type
=
chooseSubjType
(
config
)
subject
=
askSomething
(
'
Enter the subject you want to use with this nym:
'
)
configSection
(
anym
.
name
,
subject
,
subj_type
)
writeConfig
()
setActiveNym
(
anym
.
name
)
else
:
subj_type
=
"
delete
"
subject
=
"
yes
"
msg
=
prepareSetupMsg
(
gpgfuncts
.
selectSecKey
(
anym
.
name
),
subj_type
,
subject
)
emsg
=
signCryptMsg
(
msg
,
dest
,
sign
=
anym
.
fp
,
passphrase
=
pwd
)
if
not
emsg
:
config
[
'
last_message
'
]
=
"
Something went wrong while preparing the message, recipient key missing ???
"
...
...
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