nephos.manage_db
index
/media/hdd/Essentials/Chapter_Kgp_WOrk/GSoC/projectnephos_gsoc18/GSoC18Nephos/nephos/manage_db.py

Manages all the database operations

 
Modules
       
os
sqlite3

 
Classes
       
builtins.object
DBHandler

 
class DBHandler(builtins.object)
    Handles operations related to database; insertion, updating and deletion.
 
  Methods defined here:
first_time(self)
Initialise the database with important tables
    Channels:
        Stores the list of channels
 
Returns
-------

Static methods defined here:
connect()
Instantiates the class with a connection to the main database which stores
channels and share lists.
Provides cursor to the database connection.
init_jobs_db()
creates the job database file
 
Returns
-------
insert_data(db_cur, table_name, row_data)
Inserts data into tables
 
Parameters
----------
db_cur
    cursor to database
table_name
    type: str
    name of the table to which the data is to be inserted
row_data
    type: dict
    containing the key-value paired row data to be appended
 
Returns
-------
id
    type: int
    the channel_id/share_id of the new data

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        CH_COUN_INDEX = 3
CH_IP_INDEX = 2
CH_LANG_INDEX = 4
CH_NAME_INDEX = 1
CH_STAT_INDEX = 6
CH_TMZ_INDEX = 5
DB_JOBS_PATH = '/home/thealpha/Nephos/databases/jobs.db'
DB_PATH = '/home/thealpha/Nephos/databases/storage.db'
LOG = <logging.Logger object>
SL_MAIL_INDEX = 1
SL_TAG_INDEX = 2
TSK_CHNAME_INDEX = 3
TSK_FAIL_INDEX = 7
TSK_ID_INDEX = 0
TSK_LANG_INDEX = 4
TSK_PATH_INDEX = 1
TSK_SHR_INDEX = 8
TSK_STAT_INDEX = 6
TSK_STORE_INDEX = 2
TSK_SUBLANG_INDEX = 5
__nephos_dir__ = '/home/thealpha/Nephos'