baseapp Package

constants Module

dialogs Module

class leap.baseapp.dialogs.ErrorDialog(parent=None, errtype=None, msg=None, label=None)

Bases: PyQt4.QtGui.QDialog

confirmMessage(msg, label, action)
criticalMessage(msg, label)
warningMessage(msg, label)

eip Module

class leap.baseapp.eip.EIPConductorAppMixin(*args, **kwargs)

Bases: object

initializes an instance of EIPConnection, gathers errors, and passes status-change signals from Qt land along to the conductor. Connects the eip connect/disconnect logic to the switches in the app (buttons/menu items).

ERR_DIALOG = False
error_check()

consumes the conductor error queue. pops errors, and acts accordingly (launching user dialogs).

onEIPError(error)

check severity and launches dialogs informing user about the errors. in the future we plan to derive errors to our log viewer.

run_eip_checks()

runs eip checks and the error checking loop

start_or_stopVPN(**kwargs)

stub for running child process with vpn

statusUpdate()

polls status and updates ui with real time info about transferred bytes / connection state. right now is triggered by a timer tick (timer controlled by StatusAwareTrayIcon class)

leap_app Module

class leap.baseapp.leap_app.MainWindowMixin(*args, **kwargs)

Bases: object

create the main window for leap app

cleanupAndQuit()

cleans state before shutting down app.

closeEvent(event)

redefines close event (persistent window behaviour)

createMainActions()
createMainMenus()
set_app_icon()
set_statusbarMessage(msg)
stop_connection_and_launch_first_run_wizard()

log Module

class leap.baseapp.log.LogPaneMixin

Bases: object

a simple log pane that writes new lines as they come

EXCLUDES = ('MANAGEMENT',)
createLogBrowser()

creates Browser widget for displaying logs (in debug mode only).

onLoggerNewLine(line)

simple slot: writes new line to logger Pane.

mainwindow Module

class leap.baseapp.mainwindow.LeapWindow(opts)

Bases: PyQt4.QtGui.QMainWindow, leap.baseapp.leap_app.MainWindowMixin, leap.baseapp.eip.EIPConductorAppMixin, leap.baseapp.systray.StatusAwareTrayIconMixin, leap.baseapp.network.NetworkCheckerAppMixin, leap.baseapp.log.LogPaneMixin

main window for the leap app. Initializes all of its base classes We keep here some signal initialization that gets tricky otherwise.

do_first_run_wizard_check()

checks whether first run wizard needs to be run launches it if needed and emits initReady signal if not.

do_start_eipconnection()

shows icon and init eip connection called from the end of wizard

eipStatusChange
initNetworkChecker
initReady
launch_first_run_wizard()

launches wizard and blocks

mainappReady
networkError
newLogLine
onWizardCancel()
openvpnStatusChange
runchecks_and_eipconnect()

shows icon and run init checks

shutdownSignal
start_eipconnection
triggerEIPError

network Module

class leap.baseapp.network.NetworkCheckerAppMixin(*args, **kwargs)

Bases: object

initialize an instance of the Network Checker, which gathers error and passes them on.

ERR_NETERR = False
init_network_checker(provider)
onNetworkError(exc)

slot that receives a network exceptions and raises a user error message

runNetworkChecks()

permcheck Module

leap.baseapp.permcheck.is_auth_agent_running()
leap.baseapp.permcheck.is_pkexec_in_system()

systray Module

class leap.baseapp.systray.StatusAwareTrayIconMixin(*args, **kwargs)

Bases: object

a mix of several functions needed to create a systray and make it get updated from conductor status polling.

Icons = {'connected': <function <lambda> at 0xb4b979c>, 'connecting': <function <lambda> at 0xb4b9764>, 'disconnected': <function <lambda> at 0xb4b93ac>}
about()
createActions()

creates actions to be binded to tray icon

createIconGroupBox()

dummy icongroupbox (to be removed from here – reference only)

createTrayIcon()

creates the tray icon

detailsWin()
getIcon(icon_name)
iconActivated(reason)

handles left click, left double click showing the trayicon menu

iconpath = {'connected': ':/images/conn_connected.png', 'connecting': ':/images/conn_connecting.png', 'disconnected': ':/images/conn_error.png'}
onEIPConnStatusChange(newstatus)

slot for EIP status changes not to be confused with onOpenVPNStatusChange. this only updates the non-debug LEAP Status line next to the connection icon.

onOpenVPNStatusChange(status)

updates icon, according to the openvpn status change.

onTimerTick()
setConnWidget(icon_name)
setIcon(name)
setIconToolTip()

get readable status and place it on systray tooltip

show_systray_icon()
states = {'connected': 2, 'connecting': 1, 'disconnected': 0}
toggleEIPAct()

Table Of Contents

Previous topic

tests Package

Next topic

certs Package

This Page