Package pysql :: Module pysqlmain
[hide private]
[frames] | no frames]

Module pysqlmain

source code


Pysql is an Oracle client for all those who suffer from sqlplus.

It aims to bring confort and power to user without a heavy graphical application.

Developpers (in order of arrival in the project) :
- Sébastien Renard
- Sébastien Delcros
- <your name here if you want to contribute ! (your firstname must be Sebastien of course)

Requirements:
- Mandatory:
    o python. Pysql has been tested with Python 2.4.x and 2.5.0
    o cx_Oracle : http://www.cxtools.net/default.aspx?nav=cxorlb
- Optionnal:
    o pyreadline for Windows user to have input completion
    o cTypes for windows user to have input completion (already included in Python 2.5)
    o pydot for graphical functions (show datamodel in png for example)
    o pyparser as a dependancy of pydot

Supported plateforms:
- GNU/Linux (developper choice!)
- Windows (some limitations: poor completion and no colors)
- AIX (cx_Oracle is quite painfull to install, but all works correctly)

Pysql should work on many other platform (like Solaris, HPUX, MacOSX, *BSD) but has not been
tested. Feel free to report success to the pysql team.

Installation:
Very simple for the moment, you can put pysql everywhere. Just put the pysql command in your path.

Internationalisation (i18n):
Pysql is available in English (base langage for developpement) and French.
To generate other language messages, use "i18.sh" script in the pysql directory. You'll need
GNU Gettext to achieve this.
Next, to use pysql in French, set the LANG variable to fr (export LANG=fr) « et voilà » !

Documentation:
API documentation can be found in doc/ directory.
User documentation is available in pysql itself. Type « help » to get some help.

Modules overview:
- pysql.py: main module. Just used to setup i18n and fire the shell
- pysqlshell.py: user shell interaction. All pysql « command » are here.
                pysqlshell command handle argument parsing and display.
                Real works is done in pysqlfunction.
- pysqlfunction.py :advanced functions for pysql.
- pysqlconf.py: all configuration stuff (parameters, cache, history, user sql library...)
- pysqloraobject.py: object model for main Oracle objects (table, view, package, index).
                    this is used for functions like desc and edit
- pysqlgraphics.py: all graphical stuff that creates images with graphviz
- pysqlqueries.py: an effort is done to put all SQL queries in this module to have a cleaner code
- pysqlcolor.py: color bank definition
- pysqldb.py: all connection and cursor handling. Also manages background queries
- pysqlexception.py: all pysql defined exceptions

Developpement conventions:
- classes must begin with an uppercase caracter
- variables must begin with a lowercase caracter and user alternate uppercase instead of _
- all lines must be less than 109 characters (ask developpers why)
- all patches must be sent to sebastien@digitalfox.org

@author: Sébastien Renard (sebastien.renard@digitalfox.org)
@author: Sébastien Delcros (Sebastien.Delcros@gmail.com)
@license: GNU GPL V3

Functions [hide private]
 
main()
Pysql main function
source code
 
setLocale(conf)
Sets the right encoding
source code
 
parseOptions()
Parses pysql command argument using optparse python module
source code