A module to carry out certain transformations on certain data;-) It contains
many utility functions to process data to make it work with functions and
systems where standards compliance is an issue.
Author: K Raghu Prasad [Prangya Technologies Pvt. Ltd.]
License: GNU Library General Public License (Version 2)
$Revision: 0.1 $
- Method to transform the parameters for connect() function of python database
driver modules. Unfortunately there is no standards available for
either the positions of the arguments or the keywords required (for
**kwargs type parameters) for function connect(). Though almost all major
database driver modules available are "Python Database API Specification
2.0" compliant, the specs itself does not lay down any strict rules in this
area. This affects the writing of clean database independent frameworks
for software applications.
This method can be considered as a hack to overcome such problems. It takes
the parameters being supplied to the connect() method along with the module
itself and does required transformations on it after which the function
connect() is called.
**kwargs: A dictionary containing following keys and respective values:
module: A loaded python database driver module.
name: The name of this module.
host: Name of the host on which the database server is running.
port: The port number on which the server is listening.
database: The name of the database.
user: The user name required to connect to the database.
password: The password required for that user.
unixsocket: The disk based unix socket.
All keys are compulsory, though any of them can be empty string. In
such cases those parameters are not supplied to the function connect().
Returns: A database connection object obtained by calling function connect()
of supplied database driver module.
ParamException: Some required parameters are missing.
Note: Database module based exception "Error" or its subclasses are
raised too. It happens whenever the connection operation fails.
Those exceptions are not caught and handled here. The calling
program is expected (and best suited) to handle them.
||__file__ = '/usr/lib/python2.2/site-packages/xforms.pyc'|
__name__ = 'xforms'
__version__ = '0.1'