SourceForge Logo Python Documentation  
Home


Designer documentation


Python documentation

1. Inner workings
2. Python API
3. DataSource
4. Types and exceptions


Download


Credits


Contact


DataSource

Lowlevel API

Your DataSource will be called whenever AHTS encounters an identifier.

A quick summary:

Whenever AHTS encounters this action will result
@identifier@ return datasource.get("identifier")
<list name="identifier"> return datasource.prepare("identifier")
(at the start of each loop) return datasource.next("identifier")
</list> datasource.done("identifier")
<multiple name="identifier"> return datasource.prepare_multiple("identifier")
(at the start of each loop) return datasource.next_multiple("identifier")
@identifier.selector@ return datasource.get("identifier.selector")
</multiple> datasource.done_multiple("identifier")

If the datasource is asked for an identifier it can't provide, it must raise the ahts.NotDefinedError.

Higher level DataSource

If your DataSource-class inherits from ahts.DataSource, you can use following conventions:

Whenever AHTS encounters this action will result
@identifier@ return datasource.a_identifier
or return datasource.a_get_identifier()
<list name="identifier"> return datasource.a_prepare_identifier()
(at the start of each loop) return datasource.a_next_identifier()
</list> datasource.a_done_identifier()
<multiple name="identifier"> return datasource.a_m_prepare_identifier()
(at the start of each loop) return datasource.a_m_next_identifier()
@identifier.selector@ return datasource.a_get_identifier_selector()1
</multiple> datasource.a_m_done_identifier()

ahts.DataSource will raise the ahts.NotDefinedError itself if it can't find the required member-function.

1 Version 0.0 calls return datasource.a_m_get_identifier((selector,))

  $Id: datasource.tml,v 1.1 2001/04/09 22:36:19 benderydt Exp $