Package dopal :: Module scripting :: Class ScriptEnvironment
[show private | hide private]
[frames | no frames]

Type ScriptEnvironment


The ScriptEnvironment class contains values and methods useful for a script to work with.
Method Summary
  __init__(self, name, data_file)
Note - this is a module-private constructor.
  alert(self, message, alert_type, repeatable)
  get_data_dir(self, create_dir)
  get_data_file_path(self, create_dir)
  get_log_config_path(self, create_dir)
  get_log_file_path(self, create_dir)
  load_data(self)
  save_data(self, data)

Instance Variable Summary
  connection: The AzureusObjectConnection to work with.
  default_repeatable_alerts: Indicates whether alerts are repeatable or not by default.
  filename: The filename (no directory information included) of where persistent data for this object should be stored - default is data.dpl.
_lazyattr log_channel: The logger channel object to send messages to.
  logger: The logger instance to log data to.
  name: The name of the script.

Method Details

__init__(self, name, data_file='data.dpl')
(Constructor)

Note - this is a module-private constructor. The method signature for this class may change without notice.
Overrides:
__builtin__.object.__init__

Instance Variable Details

connection

The AzureusObjectConnection to work with. The connection should already be in an established state. connection may be None if ext_run is configured that way.

default_repeatable_alerts

Indicates whether alerts are repeatable or not by default. This can be set explicitly on the object, but it can also be overridden when calling the alert method. In most cases, this value will be None when instantiated, and will be automatically determined the first time the alert method is called.

filename

The filename (no directory information included) of where persistent data for this object should be stored - default is data.dpl. If you want to set a different filename, this value should be set before any saving or loading of persistent data takes place in the script.

log_channel

The logger channel object to send messages to. May be None. For convenience the alert method is available on ScriptEnvironment messages.
Type:
_lazyattr
Value:
<dopal.scripting._lazyattr object at 0x00863E10>                       

logger

The logger instance to log data to. May be None.

name

The name of the script.

Generated by Epydoc 2.1 on Wed May 03 14:22:33 2006 http://epydoc.sf.net