2.1.1 Module Level Functions

The following free functions - functions that do not belong to any class - are defined in the e32 module:

ao_yield( )

Yields to the active scheduler to have ready active objects with priority above normal scheduled for running. This has the effect of flushing the eventual pending UI events. Note that the UI callback code may be run in the context of the thread that performs an ao_yield. For information on active scheduler, see S60 SDK documentation [4].

ao_sleep( interval [, callback])
Sleeps for the given interval without blocking the active scheduler. When the optional callback is given, the call to ao_sleep returns immediately and the callback gets called after interval. See also Section 2.1.3, Ao_timer Type.

ao_callgate( wrapped_callable)
Wraps wrapped_callable into returned callable object callgate that can be called in any thread. As a result of a call to callgate, wrapped_callable gets called in the context of the thread that originally created the callgate. Arguments can be given to the call. This is actually a simple wrapping of the Symbian active object facility.

drive_list( )
Returns a list of currently visible drives as a list of Unicode strings '<driveletter>:'

file_copy( target_name, source_name)
Copies the file source_name to target_name. The names must be complete paths.

in_emulator( )
Returns True if running in an emulator, or False if running on a device.

set_home_time( time)
Set the device's time to time (see Section ).

pys60_version
A string containing the version number of the Python for S60 and some additional information.

Example:

>>> import e32
>>> e32.pys60_version
'1.9.3 svn2793'
>>>

pys60_version_info
A tuple containing the five components of the Python for S60 version number: major, minor, micro, release tag, and serial. All values except release level are integers; the release tag is a string. A value other than 'final' for the release tag signifies a development release. The pys60_version_info value corresponding to the Python for S60 version 1.9.3 is (1, 9, 3, 'svn2793', 0).

Example:

>>> import e32
>>> e32.pys60_version_info
(1, 9, 3, 'svn2793', 0)
>>>

s60_version_info
Returns the S60 platform version of the device.

Example:

>>> import e32
>>> e32.s60_version_info
(3, 0)
>>>

is_ui_thread( )
Returns True if the code that calls this function runs in the context of the UI thread; otherwise returns False.

start_exe( filename, command [,wait])
Launches the native Symbian OS executable filename (Unicode) and passes it the command string. When wait is set, the function synchronously waits for the exit of the executable and returns a value that describes the exit type. Possible values are 0 for normal exit and 2 for abnormal exit.

start_server( filename)
Starts the Python script in file filename (Unicode) as a server in its own process. Note that appuifw module is not available to a server script.

reset_inactivity( )
Resets the timers since the user was last active. As a consequence, the device backlight is normally turned on when this function is invoked.

inactivity( )
Returns the time in seconds since the user of the device was last active.

get_capabilities( )
Returns tuple of capabilities granted to the application. Example:

>>> import e32
>>> e32.get_capabilities()
('ReadUserData','WriteUserData')
>>>

has_capabilities( capability_list)
Check if the application has all the capabilities that are passed in a list, 'capability_list'. Returns True if all the capabilities specified in the list are present, False otherwise.

Examples:

>>> import e32
>>> e32.has_capabilities(['Location','ReadUserData'])
False
>>> e32.has_capabilities(['Location','SwEvent'])
False
>>> e32.has_capabilities(['WriteUserData','ReadUserData'])
True
>>>

See About this document... for information on suggesting changes.