pisak.speller package¶
pisak.speller.description module¶
pisak.speller.documents_manager module¶
Module for managing text documents created with speller application and database dedicated to them.
-
pisak.speller.documents_manager.
DOCUMENTS_DB_PATH
= '/home/alex/.pisak/databases/documents.db'¶ Path to database related to text documents
-
pisak.speller.documents_manager.
DOCUMENTS_DIR
= '/home/alex/Dokumenty'¶ Path to system’s default documents directory
-
class
pisak.speller.documents_manager.
Document
(**kwargs)[source]¶ Bases:
sqlalchemy.ext.declarative.api.Base
Class representing a row in the documents table in the database.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
-
added_on
¶
-
id
¶
-
name
¶
-
path
¶
-
-
pisak.speller.documents_manager.
FILE_NAME_BASE
= 'text_file_no_'¶ Common base for text documents’ files’ names
-
pisak.speller.documents_manager.
FILE_NAME_EXTENSION
= '.txt'¶ Extension of files’ names
-
pisak.speller.documents_manager.
add_document
(name, path)[source]¶ Insert new document related record to the database. Return path in the file system to the new document.
Parameters: - name – name of the new document.
- path – path to the new document.
-
pisak.speller.documents_manager.
generate_new_path
()[source]¶ Generate path for the new document file.
Returns: path for a text document.
-
pisak.speller.documents_manager.
get_all_documents
()[source]¶ Return all records from the database which are pointing to the existing files in the files’ system.