Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Weblate
gajim
Commits
e620b4bf
Commit
e620b4bf
authored
18 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
remove print, do 80char and use _()
parent
42f52bcd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/passwords.py
+5
-6
5 additions, 6 deletions
src/common/passwords.py
with
5 additions
and
6 deletions
src/common/passwords.py
+
5
−
6
View file @
e620b4bf
...
...
@@ -41,27 +41,26 @@ class GnomePasswordStorage(object):
def
get_password
(
self
,
account_name
):
conf
=
gajim
.
config
.
get_per
(
'
accounts
'
,
account_name
,
'
password
'
)
try
:
unused
,
auth_token
=
conf
.
split
(
"
gnomekeyring:
"
)
unused
,
auth_token
=
conf
.
split
(
'
gnomekeyring:
'
)
auth_token
=
int
(
auth_token
)
print
"
load: token for account %s: %i
"
%
(
account_name
,
auth_token
)
except
ValueError
:
password
=
conf
## migrate the password over to keyring
self
.
save_password
(
account_name
,
password
,
update
=
False
)
return
password
try
:
return
gnomekeyring
.
item_get_info_sync
(
self
.
keyring
,
auth_token
).
get_secret
()
return
gnomekeyring
.
item_get_info_sync
(
self
.
keyring
,
auth_token
).
get_secret
()
except
gnomekeyring
.
DeniedError
:
return
None
def
save_password
(
self
,
account_name
,
password
,
update
=
True
):
display_name
=
(
"
Gajim account %s
"
%
(
account_name
,))
display_name
=
_
(
'
Gajim account %s
'
)
%
account_name
attributes
=
dict
(
account_name
=
str
(
account_name
),
gajim
=
1
)
auth_token
=
gnomekeyring
.
item_create_sync
(
self
.
keyring
,
gnomekeyring
.
ITEM_GENERIC_SECRET
,
display_name
,
attributes
,
password
,
update
)
print
"
save(update=%i): token for account %s: %i
"
%
(
update
,
account_name
,
auth_token
)
token
=
"
gnomekeyring:%i
"
%
(
auth_token
,)
token
=
'
gnomekeyring:%i
'
%
(
auth_token
,)
gajim
.
config
.
set_per
(
'
accounts
'
,
account_name
,
'
password
'
,
token
)
...
...
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