data Package¶
convertdb
Module¶
-
class
pwman.data.convertdb.
DBConverter
(args, config)¶ Bases:
object
A general class to provide a base template for converting a database from one version to another
-
backup_old_db
()¶
-
convert_nodes
()¶
-
create_new_db
(new_version=0.4)¶
-
static
detect_db_version
(filename)¶ This method should accept a pwman db file name, and it should try to detect which database version it is.
-
static
invoke_converter
(dbversion, future_version)¶ this method should accept the two parameters and according to them invoke the right converter
-
print_success
()¶
-
read_old_db
()¶
-
run
()¶
-
save_new_nodes_to_db
()¶
-
save_old_key
()¶
-
-
class
pwman.data.convertdb.
PwmanConvertKey
(args, config)¶ Bases:
pwman.data.convertdb.DBConverter
-
read_old_db
()¶
-
save_old_key
()¶
-
database
Module¶
-
class
pwman.data.database.
Database
¶ Bases:
object
-
add_node
(node)¶
-
close
()¶
-
editnode
(nid, **kwargs)¶
-
fetch_crypto_info
()¶
-
get_node
(id)¶
-
get_user_password
()¶ get the databases password from the user
-
getnodes
(ids)¶
-
lazy_get_nodes
(ids)¶ iterates thought ids and yield a node for each id
-
lazy_list_node_ids
(filter=None)¶ return a generator that yields the node ids
-
loadkey
()¶ return _keycrypted
-
open
(dbver=None)¶ Open the database, by calling the _open method of the class inherited for the specific database. When done validation that the file is OK, check if it has encryption key, by calling enc = CryptoEngine.get() key = self.loadkey()
-
removenodes
(nid)¶
-
save_crypto_info
(seed, digest)¶ save the random seed and the digested key
-
savekey
(key)¶
-
-
exception
pwman.data.database.
DatabaseException
¶ Bases:
Exception
factory
Module¶
-
pwman.data.factory.
check_db_version
(dburi)¶
-
pwman.data.factory.
createdb
(dburi, version)¶
-
pwman.data.factory.
no_parse_uri
(dburi)¶
-
pwman.data.factory.
parse_postgres_uri
(dburi)¶
-
pwman.data.factory.
parse_sqlite_uri
(dburi)¶ return dburi.netloc if on windows, because this was someone break
nodes
Module¶
-
class
pwman.data.nodes.
Node
(clear_text=True, **kwargs)¶ Bases:
object
-
classmethod
from_encrypted_entries
(username, password, url, notes, tags)¶ We use this alternatively, to create a node instance when reading the encrypted entities from the database
-
notes
¶ Get the current notes.
-
password
¶ Get the current password.
-
to_encdict
()¶ Return a dictionary of encrypted records
-
url
¶ Get the current url.
-
username
¶ Get the current username.
-
classmethod