Source Code Layout
SummaryThe source code is divided into the following packages, all are sub-packages of the the overall '
ROOT: the root package contains the build scripts, copyright and release notes
winswitch: the root package contains constants, build information and other global attributes
winswitch.client: contains the classes needed for implementing clients, including the applet
winswitch.fs: filesystem support classes for both clients and servers (currently just
winswitch.net: networking utility classes:
mDNS, local socket connections, general network protocol, etc
winswitch.objects: the objects representing servers, users, sessions, settings, mount points, etc
winswitch.server: classes for implementing servers, including server-side session utility wrappers
winswitch.sound: everything related to sound support
winswitch.twisted: twisted enhancements required for supporting hidden shell processes with
Twistedon MS Windows
winswitch.ui: all the user interface classes: utility classes, configuration dialogs and operating system specific code for desktop interaction
winswitch.util: generic utility classes: key management, encryption, authentication, file handling, logging, desktop menu integration, etc
winswitch.virt: virtualization classes: both client and server support classes for all the underlying protocols supported (NX, Xpra, VNC,...)
ServerLink class is central to the whole system on the client side.
It represents the link to a server instance, including SSH tunnels if needed.
It is a lower level utility class, as such it does not depend on any user interface classes or functions, these must be injected by any classes using it from a context that requires user interaction. If these are not set, the functionality will simply be disabled. This is done by setting:
message_handler(ServerConfig, title, text, type): this will be used for event notifications
question_handler(title, text, nok_callback, ok_callback, password, buttons, icon, UUID): this is used for asking the user for confirmation, keys, passphrases etc.
cancel_question(UUID): this is used for cancelling a question when it becomes irrelevant
DialogUtilclass documented below.
The most commonly used public methods on this class are:
stop(): log outs from the server and disconnects
kick(): tries to re-connect to the server
DialogUtilclass provides utility functions for interacting with the user via dialogs.
The public functions are:
ask(title, text, cancel_callback, ok_callback, password=False, buttons=None, icon=None, UUID=None): implements a simple dialog window which can be used to ask the user generic questions and may include a password field. The UUID can be used to ensure that the same dialog is now shown multiple times and that it can be cancelled.
cancel_ask(UUID): is used to cancel an existing dialog