eric3.Utilities.Startup

Module implementing some startup helper funcions

Classes

None

Functions

handleArgs Function to handle the always present commandline options.
initializeMimeSourceFactory Function to load all required translations.
loadTranslatorForLocale Function to find and load a specific translation.
makeAppInfo Function to generate a dictionary describing the application.
simpleAppStartup Function to start up an application that doesn't need a specialized start up.
usage Function to show the usage information.
version Function to show the version information.

handleArgs

handleArgs(argv, appinfo)

Function to handle the always present commandline options.

appinfo
dictionary describing the application
argv
list of commandline parameters (list of strings)
Returns:
index of the '--' option (integer). This is used to tell the application, that all additional option don't belong to the application.
Up

initializeMimeSourceFactory

initializeMimeSourceFactory(ericDir)

Function to load all required translations.

app
reference to the application object (QApplication)
ericDir
directory of the eric3 installation (string)
qtDir
directory of the Qt installation (string)
translationFiles
tuple of additional translations to be loaded (tuple of strings)
Returns:
the requested locale (string)
Up

loadTranslatorForLocale

loadTranslatorForLocale(dirs, tn)

Function to find and load a specific translation.

dirs
Searchpath for the translations. (list of strings)
tn
The translation to be loaded. (string)
Returns:
Tuple of a status flag and the loaded translator. (int, QTranslator)
Up

makeAppInfo

makeAppInfo(argv, name, arg, description, options = [])

Function to generate a dictionary describing the application.

arg
commandline arguments (string)
argv
list of commandline parameters (list of strings)
description
text describing the application (string)
name
name of the application (string)
options
list of additional commandline options (list of tuples of two strings (commandline option, option description)). The options --version, --help and -h are always present and must not be repeated in this list.
Returns:
dictionary describing the application
Up

simpleAppStartup

simpleAppStartup(argv, appinfo, mwFactory)

Function to start up an application that doesn't need a specialized start up. This function is used by all of eric3's helper programs.

appinfo
dictionary describing the application
argv
list of commandline parameters (list of strings)
mwFactory
factory function generating the main widget. This function must accept the following parameters.
argv
list of commandline parameters (list of strings)
qtDir
directory of the Qt installation (string)
ericDir
directory of the eric3 installation (string)
Up

usage

usage(appinfo, optlen = 12)

Function to show the usage information.

appinfo
dictionary describing the application
optlen
length of the field for the commandline option (integer)
Up

version

version(appinfo)

Function to show the version information.

appinfo
dictionary describing the application
Up