appbase package

appbase is the foundation for a pyQt based application including:

  • save, load, autosave
  • session management
  • fullscreen with F11
  • close-dialog
  • system tray control

Submodules

appbase.Application module

class appbase.Application.Application(args, **kwargs)[source]

Bases: PyQt4.QtGui.QApplication

A normal QtGui.QApplication with embedded session management

appbase.Launcher module

class appbase.Launcher.Launcher(title='PYZ-Launcher', icon=None, start_script=None, left_header=None, right_header=None, file_type='pyz')[source]

Bases: PyQt4.QtGui.QMainWindow

A graphical starter for *.pyz files created by the save-method from appbase.MainWindow

NEEDS AN OVERHAUL ... after that’s done it will be able to:

  • show all *.pyz-files in a filetree

  • show the session specific ...

    • icon
    • description
    • author etc.
  • start, remove, rename, modify a session

  • modify, start a certain state of a session

static rootDir()[source]

appbase.MainWindow module

class appbase.MainWindow.MainWindow(title='')[source]

Bases: PyQt4.QtGui.QMainWindow

template for QMainWindow including:

  • a menu bar with all common features
  • fullscreen with F11
  • changed window title when saved under a new name
  • Preferences in Menubar->File
  • autosave
  • close dialog
closeEvent(evt)[source]
setTitleAdditive(value='')[source]
setTitlePath(value='')[source]

appbase.MultiWorkspaceWindow module

class appbase.MultiWorkspaceWindow.MultiWorkspaceWindow(workspaceClass, *args, **kwargs)[source]

Bases: appbase.MainWindow.MainWindow

Adding workspace management to appbase.MainWindow

  • ‘Workspace’ menu in menu bar
  • Switch between workspaces with [Ctrl]+[Page up/down]
  • Add workspace with [Ctrl]+[W]
  • Remove current workspace with [Ctrl]+[Q]
addWorkspace()[source]
closeCurrentWorkspace()[source]
closeWorkspace(ws)[source]
currentWorkspace()[source]
showNextWorkspace()[source]
showPreviousWorkspace()[source]
showWorkspace(i)[source]
workspaces(index=None)[source]

return generator for all all workspace instances

appbase.Server module

class appbase.Server.Server(win, parent=None)[source]

Bases: PyQt4.QtGui.QSystemTrayIcon

a system tray icon to

  • show/hide the current session [left mouse button]
  • show options(load, save, new) [right mouse button]
clickTrap(value)[source]
showMainWindow()[source]
toggleShowHide()[source]

appbase.Session module

class appbase.Session.Session(args, **kwargs)[source]

Bases: PyQt4.QtCore.QObject

Session management to be accessible in QtGui.QApplication.instance().session

  • extract the opened (as pyz-zipped) session in a temp folder
  • create 2nd temp-folder for sessions to be saved
  • send a close signal to all child structures when exit
  • write a log file with all output
  • enable icons in menus of gnome-sessions [linux only]
  • gives option of debug mode
addSession()[source]
blockingSave(path)[source]

saved session to file - returns after finish only called by interactiveTutorial-save at the moment

checkMaxSessions(nMax=None)[source]

check whether max. number of saved sessions is reached if: remove the oldest session

new(filename=None)[source]

start a session an independent process

open()[source]

open a session to define in a dialog in an extra window

quit()[source]
registerMainWindow(win)[source]
renameState(oldStateName, newStateName)[source]
replace(path)[source]

replace current session with one given by file path

restoreCurrentState()[source]
restoreNextState()[source]
restorePreviousState()[source]
restoreStateName(name)[source]

restore the state of given [name]

save()[source]

save the current session override, if session was saved earlier

saveAs(filename=None)[source]
setSessionPath(path, statename=None)[source]
sigRestore
sigSave
stateNames()[source]

Returns: list: the names of all saved sessions

writeLog(write=True)[source]