SchemeHandlers are used by Sablotron to resolve URLs that use other schemes than the builtin file: and arg:(eg. http: or ftp:). An example scheme handler that uses the standard python module urllib.py is provided in the file urlhandler.py.
Aside from the example file urlhandler.py there is no class or type in Sablot that implements SchemeHandler. This is an interface that must be implemented by the user in some class. A class instance of this implementation is then passed to regHandler().
In the C level interface to Sablotrons, SchemeHandlers return an error code to Sablotron. Because the return code of the methods below is used for other values, the error code must be passed in a different way. Sab-pyth defines the exception SchemeHandlerError for this. By calling raise SchemeHandlerError, code from within a handler method, you pass code to the C level Sablotron API.
scheme = URI scheme (e.g. "http")
rest = the rest of the URI (without colon)
scheme = URI scheme (e.g. "http")
rest = the rest of the URI (without colon)
handle = the handle assigned on open
byteCount = number of bytes to read (the number actually read is returned here)
handle = the handle assigned on open
string = the data
handle = the handle assigned on open