2019-07-22 17:37:35 +02:00
|
|
|
#!/usr/bin/python3
|
2016-08-05 01:43:09 +02:00
|
|
|
|
|
|
|
import sys
|
2019-08-15 08:45:13 +02:00
|
|
|
from getpass import getpass
|
|
|
|
import secretstorage
|
|
|
|
|
|
|
|
connection = secretstorage.dbus_init()
|
|
|
|
collection = secretstorage.get_collection_by_alias(connection, "login")
|
|
|
|
attributes = {"application": "mbsync", "account": sys.argv[1]}
|
2016-08-05 01:43:09 +02:00
|
|
|
|
2019-08-15 08:45:13 +02:00
|
|
|
collection.create_item(
|
|
|
|
"Password for '{}' on '{}'".format(
|
|
|
|
attributes["account"], attributes["application"]
|
|
|
|
),
|
|
|
|
attributes,
|
|
|
|
getpass().encode(),
|
|
|
|
)
|