Core Objects

Application Globals

The app_globals file contains pointers in application scope.

# Typical usage
import app_globals as G

# access the settings
G.settings.get_servers()
pyqtdb.app_globals.docs_gen = '1'

Flag to indicate Sphinx docs gen, Quirk of ReadTheDocs.org

pyqtdb.app_globals.settings = <pyqtdb.XSettings.XSettings object>

Global settings instance of XSettings

XSettings

class pyqtdb.XSettings.XSettings[source]

Bases: QSettings

This class is intended as a central place to hold the config. The idea is that later if can use different backends.

Some data such as the server config is serialised as json (a dependancy)

Warning

Security risk - the passwords are not encrypted

Todo

Inplement yaml backend and json

NS = 'PYQTDB'

Namespace prepended to all keys

SERVERS = 'PYQTDB_serversss'

Key that hold the servers data

delete_server(server)[source]
get_server(srv)[source]
Parameters:server – The string with server host
Returns:A dict() with the server details or None if not found
get_servers_dic()[source]
Returns:A dict() with the server details or None if not found
get_servers_list()[source]
Returns:A list() of dict() with the server details or None if not found
initialize()[source]

Initialise and check settings. Executed once on startup

restore_window(window)[source]

Convenience function to restore window

save_server(dic)[source]
Parameters:dic – The dict with the server details
save_window(window)[source]

Convenience functin to save window

DBMainWindow

class pyqtdb.DBMainWindow.DBMainWindow(parent=None)[source]

Bases: QMainWindow

Main Window and Portal

Todo

Remember the dock position

W_NAME = 'DBMainWindow'
closeEvent(event)[source]

Save window settings on close with save_window

on_open_server(srv)[source]

Opens server by adding a DBBrowser in the the tabWidget

serversWidget = None

Instance of DBServersWidget in dock

tabWidget = None

The main tabs

pyqtdb.DBMainWindow.show_splash()[source]

Show the splash screen

Images Helper

class pyqtdb.img.Ico[source]

Icons Definition and Loader

  • All icons used are listed as class constants.
  • Static methods create icons loaded from the file system
Cancel = 'bullet_black.png'
Connect = 'connect.png'
Disconnect = 'disconnect.png'
FavIcon = 'page_white_swoosh.png'
Save = 'accept.png'
Server = 'server.png'
ServerAdd = 'server_add.png'
ServerConnect = 'server_connect.png'
ServerDelete = 'server_delete.png'
ServerEdit = 'server_edit.png'
Servers = 'server_database.png'
static icon(file_name, pixmap=False)[source]

Create a new QIcon @param file_name: Icon filename to load @type file_name: str or L{dIco} attribute @param pixmap: Return a pixmap instead of icon object @type pixmap: bool @return: new Icon @rtype: QIcon or pixmap