Changeset 222:ca0cd9ced5ba in livinglogic.python.orasql

Show
Ignore:
Timestamp:
01/30/08 22:43:37 (12 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Switch docstrings to ReST and encoding to UTF-8. Update copyright year.

Files:
9 modified

Legend:

Unmodified
Added
Removed
  • setup.py

    r221 r222  
    11#!/usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
     2# -*- coding: utf-8 -*- 
    33 
    44# Setup script for ll-orasql 
  • src/ll/__init__.py

    r205 r222  
    11#! /usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
     2# -*- coding: utf-8 -*- 
    33 
    4 ## Copyright 1999-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 1999-2007 by Walter Dörwald 
     4## Copyright 1999-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 1999-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved 
     
    2424try: 
    2525    __import__("pkg_resources").declare_namespace(__name__) 
    26 except (SystemExit, KeyboardInterrupt): 
    27     raise 
    2826except Exception: 
    2927    pass 
  • src/ll/orasql/__init__.py

    r207 r222  
    11#!/usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
    3  
    4 ## Copyright 2004-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 2004-2007 by Walter Dörwald 
     2# -*- coding: utf-8 -*- 
     3 
     4## Copyright 2004-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 2004-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved 
     
    2323 
    2424""" 
    25 <p><mod>ll.orasql</mod> contains utilities for working with 
    26 <a href="http://www.computronix.com/utilities.shtml#Oracle"><app>cx_Oracle</app></a>:</p> 
    27 <ul> 
    28 <item>It allows calling procedures with keyword arguments (via the 
    29 <pyref class="Procedure"><class>Procedure</class></pyref> class).</item> 
    30 <item>Query results will be put into <pyref class="Record"><class>Record</class></pyref> 
    31 objects, where database fields are accessible as object attributes.</item> 
    32 <item>The <pyref class="Connection"><class>Connection</class></pyref> class 
    33 provides methods for iterating through the database metadata.</item> 
    34 </ul> 
     25:mod:`ll.orasql` contains utilities for working with cx_Oracle__: 
     26 
     27*   It allows calling procedures with keyword arguments (via the 
     28    :class:`Procedure` class). 
     29 
     30*   Query results will be put into :class:`Record` objects, where database 
     31    fields are accessible as object attributes. 
     32 
     33*   The :class:`Connection` class provides methods for iterating through the 
     34    database metadata. 
     35 
     36__ http://www.computronix.com/utilities.shtml#Oracle 
    3537""" 
    3638 
     
    5355except ImportError: 
    5456    ipipe = None 
     57 
     58 
     59__docformat__ = "reStructuredText" 
    5560 
    5661 
     
    104109class Record(dict): 
    105110    """ 
    106     A <class>Record</class> is a subclass of <class>dict</class> that is used 
    107     for storing results of database queries. Both item and attribute access (i.e. 
    108     <meth>__getitem__</meth> and <meth>__getattr__</meth>) are available. 
    109     Field names are case insensitive. 
     111    A :class:`Record` is a subclass of :class:`dict` that is used for storing 
     112    results of database queries. Both item and attribute access (i.e. 
     113    :meth:`__getitem__` and :meth:`__getattr__`) are available. Field names are 
     114    case insensitive. 
    110115    """ 
    111116    def __init__(self, arg=None, **kwargs): 
     
    122127    def fromdata(cls, cursor, row): 
    123128        """ 
    124         This class method can be used to create a <class>Record</class> instance 
    125         from the database data. 
     129        This class method can be used to create a :class:`Record` object from the 
     130        database data. 
    126131        """ 
    127132        return cls((descr[0].lower(), _promotevalue(field, cursor, descr[1] is BLOB)) for (descr, field) in itertools.izip(cursor.description, row)) 
     
    188193class SessionPool(SessionPool): 
    189194    """ 
    190     <class>SessionPool</class> is a subclass of <class>cx_Oracle.SessionPool</class>. 
     195    :class:`SessionPool` is a subclass of :class:`cx_Oracle.SessionPool`. 
    191196    """ 
    192197 
     
    205210class Connection(Connection): 
    206211    """ 
    207     <class>Connection</class> is a subclass of <class>cx_Oracle.Connection</class>. 
     212    :class:`Connection` is a subclass of :class:`cx_Oracle.Connection`. 
    208213    """ 
    209214    def __init__(self, *args, **kwargs): 
    210215        """ 
    211         <p>Create a new connection. In addition to the parameters supported 
    212         by <func>cx_Oracle.connect</func> the following keyword arguments 
    213         are supported.</p> 
    214         <dl> 
    215         <term><arg>readlobs</arg></term><item>If <arg>readlobs</arg> is <lit>False</lit> 
    216         all cursor fetch return <class>LOB</class> objects as usual. If 
    217         <arg>readlobs</arg> is an <class>int</class> (or <class>long</class>) 
    218         <class>LOB</class>s with a maximum size of <arg>readlobs</arg> 
    219         will be returned as strings. If <arg>readlobs</arg> is <lit>True</lit> 
    220         all <class>LOB</class>s will be returned as strings.</item> 
    221         <term><arg>unicode</arg></term><item>If <arg>unicode</arg> is true, 
    222         strings (and <class>CLOB</class>s, if <arg>readlobs</arg> has the appropriate 
    223         value) will be returned as <class>unicode</class> objects (except for 
    224         <class>BLOB</class>s). Note that strings in the national character set 
    225         (and <class>NCLOB</class>s) are not supported).</item> 
    226         </dl> 
     216        Create a new connection. In addition to the parameters supported by 
     217        :func:`cx_Oracle.connect` the following keyword arguments are supported. 
     218 
     219        :var:`readlobs` : bool or integer 
     220            If :var:`readlobs` is :const:`False` all cursor fetch return 
     221            :class:`LOB` objects as usual. If :var:`readlobs` is an :class:`int` 
     222            (or :class:`long`) :class:`LOB`s with a maximum size of :var:`readlobs` 
     223            will be returned as strings. If :var:`readlobs` is :const:`True` 
     224            all :class:`LOB` values will be returned as strings. 
     225 
     226        :var:`unicode` : bool 
     227            If :var:`unicode` is true, strings (and :class:`CLOB` values, if 
     228            :var:`readlobs` has the appropriate value) will be returned as 
     229            :class:`unicode` objects (except for :class:`BLOB` values). Note that 
     230            strings in the national character set (and :class:`NCLOB` values) are 
     231            not supported). 
    227232        """ 
    228233        if "readlobs" in kwargs or "unicode" in kwargs: 
     
    240245    def cursor(self, readlobs=None, unicode=None): 
    241246        """ 
    242         Return a new cursor for this connection. For the meaning 
    243         of <arg>readlobs</arg> and <arg>unicode</arg> see 
    244         <pyref method="__init__"><meth>__init__</meth></pyref>. 
     247        Return a new cursor for this connection. For the meaning of 
     248        :var:`readlobs` and :var:`unicode` see :meth:`__init__`. 
    245249        """ 
    246250        return Cursor(self, readlobs=readlobs, unicode=unicode) 
     
    259263    def iterschema(self, schema="user"): 
    260264        """ 
    261         <p>Generator that returns the number of different object types for this 
    262         database.</p> 
    263          
    264         <p>For the meaning of <arg>schema</arg> see 
    265         <pyref method="iterobjects"><meth>iterobjects</meth></pyref>.</p> 
     265        Generator that returns the number of different object types for this 
     266        database. For the meaning of :var:`schema` see :meth:`iterobjects`. 
    266267        """ 
    267268        cursor = self.cursor() 
     
    286287    def itertables(self, schema="user"): 
    287288        """ 
    288         <p>Generator that yields all table definitions in the current users schema 
    289         (or all users schemas).</p> 
    290         <p><arg>schema</arg> specifies from which tables should be 
    291         yielded:</p> 
    292         <dl> 
    293         <term><lit>"user"</lit></term><item>Only tables belonging to the current 
    294         user (and those objects these depend on) will be yielded.</item> 
    295         <term><lit>"all"</lit></term><item>All tables from all users will be 
    296         yielded.</item> 
    297         </dl> 
    298         <p>Tables that are materialized view will be skipped in both casess.</p> 
     289        Generator that yields all table definitions in the current users schema 
     290        (or all users schemas). :var:`schema` specifies from which tables should 
     291        be yielded: 
     292 
     293        ``"user"`` 
     294            Only tables belonging to the current user (and those objects these 
     295            depend on) will be yielded. 
     296 
     297        ``"all"`` 
     298            All tables from all users will be yielded. 
     299 
     300        Tables that are materialized view will be skipped in both casess. 
    299301        """ 
    300302        if schema not in ("user", "all"): 
     
    312314    def iterfks(self, schema="user"): 
    313315        """ 
    314         <p>Generator that yields all foreign key constraints in the current users schema 
    315         (or all users schemas).</p> 
    316         <p><arg>schema</arg> specifies from which tables should be 
    317         yielded:</p> 
    318         <dl> 
    319         <term><lit>"user"</lit></term><item>Only tables belonging to the current 
    320         user (and those objects these depend on) will be yielded.</item> 
    321         <term><lit>"all"</lit></term><item>All tables from all users will be 
    322         yielded.</item> 
    323         </dl> 
     316        Generator that yields all foreign key constraints in the current users 
     317        schema (or all users schemas). :var:`schema` specifies from which tables 
     318        should be yielded: 
     319 
     320        ``"user"`` 
     321            Only tables belonging to the current user (and those objects these 
     322            depend on) will be yielded. 
     323 
     324        ``"all"`` 
     325            All tables from all users will be yielded. 
    324326        """ 
    325327        if schema not in ("user", "all"): 
     
    337339    def iterobjects(self, mode="create", schema="user"): 
    338340        """ 
    339         <p>Generator that yields the sequences, tables, primary keys, 
    340         foreign keys, comments, unique constraints, indexes, views, functions, 
    341         procedures, packages and types in the current users schema (or all users 
    342         schemas) in a specified order.</p> 
    343         <p><arg>mode</arg> specifies the order in which objects will be yielded:</p> 
    344         <dl> 
    345         <term><lit>"create"</lit></term><item>Create order, i.e. recreating the 
    346         objects in this order will not lead to errors.</item> 
    347         <term><lit>"drop"</lit></term><item>Drop order, i.e. dropping the 
    348         objects in this order will not lead to errors.</item> 
    349         <term><lit>"flat"</lit></term><item>Unordered.</item> 
    350         </dl> 
    351         <p><arg>schema</arg> specifies from which schema objects should be 
    352         yielded:</p> 
    353         <dl> 
    354         <term><lit>"user"</lit></term><item>Only objects belonging to the current 
    355         user (and those objects these depend on) will be yielded.</item> 
    356         <term><lit>"all"</lit></term><item>All objects from all users will be 
    357         yielded.</item> 
    358         </dl> 
     341        Generator that yields the sequences, tables, primary keys, foreign keys, 
     342        comments, unique constraints, indexes, views, functions, procedures, 
     343        packages and types in the current users schema (or all users schemas) 
     344        in a specified order. 
     345 
     346        :var:`mode` specifies the order in which objects will be yielded: 
     347 
     348        ``"create"`` 
     349            Create order, i.e. recreating the objects in this order will not lead 
     350            to errors. 
     351 
     352        ``"drop"`` 
     353            Drop order, i.e. dropping the objects in this order will not lead to 
     354            errors. 
     355 
     356        ``"flat"`` 
     357            Unordered. 
     358 
     359        :var:`schema` specifies from which schema objects should be yielded: 
     360 
     361        ``"user"`` 
     362            Only objects belonging to the current user (and those objects these 
     363            depend on) will be yielded. 
     364 
     365        ``"all"`` 
     366            All objects from all users will be yielded. 
    359367        """ 
    360368        if mode not in ("create", "drop", "flat"): 
     
    491499    def iterprivileges(self, schema="user"): 
    492500        """ 
    493         <p>Generator that yields object privileges for the current users 
    494         (or all users) objects.</p> 
    495         <p><arg>schema</arg> specifies which privileges should be yielded:</p> 
    496         <dl> 
    497         <term><lit>"user"</lit></term><item>Only object privileges for objects 
    498         belonging to the current user will be yielded.</item> 
    499         <term><lit>"all"</lit></term><item>All object privileges will be yielded.</item> 
    500         </dl> 
     501        Generator that yields object privileges for the current users (or all 
     502        users) objects. :var:`schema` specifies which privileges should be 
     503        yielded: 
     504 
     505        ``"user"`` 
     506            Only object privileges for objects belonging to the current user will 
     507            be yielded. 
     508 
     509        ``"all"`` 
     510            All object privileges will be yielded. 
    501511        """ 
    502512        return Privilege.iterobjects(self, schema) 
     
    505515def connect(*args, **kwargs): 
    506516    """ 
    507     Create a connection to the database and return a 
    508     <pyref class="Connection"><class>Connection</class></pyref> object. 
     517    Create a connection to the database and return a :class:`Connection` object. 
    509518    """ 
    510519    return Connection(*args, **kwargs) 
     
    513522class Cursor(Cursor): 
    514523    """ 
    515     A subclass of <mod>cx_Oracle</mod>s cursor class. Database results 
    516     returned from <meth>fetchone</meth>, <meth>fetchmany</meth>, 
    517     <meth>fetchall</meth> and <meth>fetch</meth> or by iterating the 
    518     cursor will be returned as <pyref class="Record"><class>Record</class> objects. 
     524    A subclass of the cursor class in :mod:`cx_Oracle`. Database results 
     525    returned from :meth:`fetchone`, :meth:`fetchmany`, :meth:`fetchall` and 
     526    :meth:`fetch` or by iterating the cursor will be returned as 
     527    :class:`Record` objects. 
    519528    """ 
    520529    def __init__(self, connection, readlobs=None, unicode=None): 
    521530        """ 
    522         Return a new cursor for the connection <arg>connection</arg>. 
    523         For the meaning of <arg>readlobs</arg> and <arg>unicode</arg> see 
    524         <pyref class="Connection" method="__init__"><class>Connection</class>s constructor</pyref>. 
     531        Return a new cursor for the connection :var:`connection`. For the meaning 
     532        of :var:`readlobs` and :var:`unicode` see :meth:`Connection.__init__. 
    525533        """ 
    526534        super(Cursor, self).__init__(connection) 
     
    677685class Object(object): 
    678686    """ 
    679     <p>The base class for all Python classes modelling schema objects in the 
    680     database.</p> 
    681  
    682     <p>Subclasses are: 
    683     <pyref class="Sequence"><class>Sequence</class></pyref>, 
    684     <pyref class="Table"><class>Table</class></pyref>, 
    685     <pyref class="PrimaryKey"><class>PrimaryKey</class></pyref>, 
    686     <pyref class="Comment"><class>Comment</class></pyref>, 
    687     <pyref class="ForeignKey"><class>ForeignKey</class></pyref>, 
    688     <pyref class="Index"><class>Index</class></pyref>, 
    689     <pyref class="Unique"><class>Unique</class></pyref>, 
    690     <pyref class="Synonym"><class>Synonym</class></pyref>, 
    691     <pyref class="View"><class>View</class></pyref>, 
    692     <pyref class="MaterializedView"><class>MaterializedView</class></pyref>, 
    693     <pyref class="Library"><class>Library</class></pyref>, 
    694     <pyref class="Function"><class>Function</class></pyref>, 
    695     <pyref class="Package"><class>Package</class></pyref>, 
    696     <pyref class="Type"><class>Type</class></pyref>, 
    697     <pyref class="Trigger"><class>Trigger</class></pyref>, 
    698     <pyref class="JavaSource"><class>JavaSource</class></pyref> and 
    699     <pyref class="Column"><class>Column</class></pyref>. 
    700     </p> 
    701     """ 
    702     name2type = {} # maps the Oracle type name to the Python class 
     687    The base class for all Python classes modelling schema objects in the 
     688    database. 
     689 
     690    Subclasses are: :class:`Sequence`, :class:`Table`, :class:`PrimaryKey`, 
     691    :class:`Comment`, :class:`ForeignKey`, :class:`Index`, :class:`Unique`, 
     692    :class:`Synonym`, :class:`View`, :class:`MaterializedView`, :class:`Library`, 
     693    :class:`Function`, :class:`Package`, :class:`Type`, :class:`Trigger`, 
     694    :class:`JavaSource` and:class:`Column`. 
     695    """ 
     696    name2type = {} # maps the Oracle type name to the Python class (populated by the metaclass) 
    703697 
    704698    class __metaclass__(type): 
     
    744738    def createddl(self, connection=None, term=True): 
    745739        """ 
    746         &sql; to create this object. 
     740        Return SQL code to create this object. 
    747741        """ 
    748742 
     
    750744    def dropddl(self, connection=None, term=True): 
    751745        """ 
    752         &sql; to drop this object 
     746        Return SQL code to drop this object 
    753747        """ 
    754748 
     
    756750    def cdate(self, connection=None): 
    757751        """ 
    758         Return a <class>datetime.datetime</class> object with the creation date of 
    759         <self/> in the database specified by <arg>connection</arg> (or <lit>None</lit> 
    760         if such information is not available). 
     752        Return a :class:`datetime.datetime` object with the creation date of 
     753        :var:`self` in the database specified by :var:`connection` (or 
     754        :const:`None` if such information is not available). 
    761755        """ 
    762756 
     
    764758    def udate(self, connection=None): 
    765759        """ 
    766         Return a <class>datetime.datetime</class> object with the last modification 
    767         date of <self/> in the database specified by <arg>connection</arg> 
    768         (or <lit>None</lit> if such information is not available). 
     760        Return a :class:`datetime.datetime` object with the last modification 
     761        date of :var:`self` in the database specified by :var:`connection` 
     762        (or :const:`None` if such information is not available). 
    769763        """ 
    770764 
    771765    def iterreferences(self, connection=None): 
    772766        """ 
    773         <p>Objects directly used by <self/>.</p> 
    774  
    775         <p>If <arg>connection</arg> is not <lit>None</lit> it will be used as 
    776         the database connection from which to fetch data. If <arg>connection</arg> is <lit>None</lit> 
    777         the connection from which <self/> has been extracted will be used. If 
    778         there is not such connection, you'll get an exception.</p> 
     767        Objects directly used by :var:`self`. 
     768 
     769        If :var:`connection` is not :const:`None` it will be used as the database 
     770        connection from which to fetch data. If :var:`connection` is :const:`None` 
     771        the connection from which :var:`self` has been extracted will be used. If 
     772        there is not such connection, you'll get an exception. 
    779773        """ 
    780774        (connection, cursor) = self.getcursor(connection) 
     
    790784    def iterreferencesall(self, connection=None, done=None): 
    791785        """ 
    792         <p>All objects used by <self/> (recursively).</p> 
    793  
    794         <p>For the meaning of <arg>connection</arg> see 
    795         <pyref method="iterreferences"><meth>iterreferences</meth></pyref>.</p> 
    796  
    797         <p><arg>done</arg> is used internally and shouldn't be passed.</p> 
     786        All objects used by :var:`self` (recursively). 
     787 
     788        For the meaning of :var:`connection` see :meth:`iterreferences`. 
     789 
     790        :var:`done` is used internally and shouldn't be passed. 
    798791        """ 
    799792        if done is None: 
     
    808801    def iterreferencedby(self, connection=None): 
    809802        """ 
    810         <p>Objects using <self/>.</p> 
    811  
    812         <p>For the meaning of <arg>connection</arg> see 
    813         <pyref method="iterreferences"><meth>iterreferences</meth></pyref>.</p> 
     803        Objects using :var:`self`. 
     804 
     805        For the meaning of :var:`connection` see :meth:`iterreferences`. 
    814806        """ 
    815807        (connection, cursor) = self.getcursor(connection) 
     
    825817    def iterreferencedbyall(self, connection=None, done=None): 
    826818        """ 
    827         <p>All objects depending on <self/> (recursively).</p> 
    828  
    829         <p>For the meaning of <arg>connection</arg> see 
    830         <pyref method="iterreferences"><meth>iterreferences</meth></pyref>.</p> 
    831  
    832         <p><arg>done</arg> is used internally and shouldn't be passed.</p> 
     819        All objects depending on :var:`self` (recursively). 
     820 
     821        For the meaning of :var:`connection` see :meth:`iterreferences`. 
     822 
     823        :var:`done` is used internally and shouldn't be passed. 
    833824        """ 
    834825        if done is None: 
     
    861852    def iterobjects(cls, connection, schema="user"): 
    862853        """ 
    863         <p>Generator that yields all objects of this type in the database schema 
    864         of <arg>cursor</arg>.</p> 
     854        Generator that yields all objects of this type in the database schema 
     855        of :var:`cursor`. 
    865856        """ 
    866857        cursor = connection.cursor() 
     
    940931    def createddlcopy(self, connection=None, term=True): 
    941932        """ 
    942         &sql; to create an identical copy of this sequence. 
     933        Return SQL code to create an identical copy of this sequence. 
    943934        """ 
    944935        return self._createddl(connection, term, True) 
     
    10481039    def mview(self, connection=None): 
    10491040        """ 
    1050         The materialized view this table belongs to (or <lit>None</lit> if it's a real table). 
     1041        The materialized view this table belongs to (or :const:`None` if it's a 
     1042        real table). 
    10511043        """ 
    10521044        (connection, cursor) = self.getcursor(connection) 
     
    10741066    def itercolumns(self, connection=None): 
    10751067        """ 
    1076         <p>Generator that yields all column objects of the <class>Table</class> <self/>.</p> 
     1068        Generator that yields all column objects of the :class:`Table` :var:`self`. 
    10771069        """ 
    10781070        (connection, cursor) = self.getcursor(connection) 
     
    10841076    def iterrecords(self, connection=None): 
    10851077        """ 
    1086         <p>Generator that yields all records of the table <self/>.</p> 
     1078        Generator that yields all records of the table :var:`self`. 
    10871079        """ 
    10881080        (connection, cursor) = self.getcursor(connection) 
     
    10931085    def itercomments(self, connection=None): 
    10941086        """ 
    1095         Generator that yields all <pyref class="Comment">column comments</pyref> of the table <self/>. 
     1087        Generator that yields all column comments of the table :var:`self`. 
    10961088        """ 
    10971089        (connection, cursor) = self.getcursor(connection) 
     
    11021094    def iterconstraints(self, connection=None): 
    11031095        """ 
    1104         Generator that yields all <pyref class="Constraint">constraints</pyref> for this table. 
     1096        Generator that yields all constraints for this table. 
    11051097        """ 
    11061098        (connection, cursor) = self.getcursor(connection) 
     
    11421134class Constraint(Object): 
    11431135    """ 
    1144     Base class of all constraints (primary key constraints, foreign key constraints 
    1145     and unique constraints). 
     1136    Base class of all constraints (primary key constraints, foreign key 
     1137    constraints and unique constraints). 
    11461138    """ 
    11471139 
     
    12171209    def table(self, connection=None): 
    12181210        """ 
    1219         Return the <pyref class="Table"><class>Table</class></pyref> <self/> belongs to. 
     1211        Return the :class:`Table` :var:`self` belongs to. 
    12201212        """ 
    12211213        (connection, cursor) = self.getcursor(connection) 
     
    13521344    def table(self, connection=None): 
    13531345        """ 
    1354         Return the <pyref class="Table"><class>Table</class></pyref> <self/> belongs to. 
     1346        Return the :class:`Table` :var:`self` belongs to. 
    13551347        """ 
    13561348        (connection, cursor) = self.getcursor(connection) 
     
    13611353    def pk(self, connection=None): 
    13621354        """ 
    1363         Return the <pyref class="PrimaryKey">primary key</pyref> referenced by <self/>. 
     1355        Return the primary key referenced by :var:`self`. 
    13641356        """ 
    13651357        (connection, cursor) = self.getcursor(connection) 
     
    14251417    def constraint(self, connection=None): 
    14261418        """ 
    1427         If this index is generated by a constraint, return the constraint otherwise return <lit>None</lit>. 
     1419        If this index is generated by a constraint, return the constraint 
     1420        otherwise return :const:`None`. 
    14281421        """ 
    14291422        (connection, cursor) = self.getcursor(connection) 
     
    14511444    def table(self, connection=None): 
    14521445        """ 
    1453         Return the <pyref class="Table"><class>Table</class></pyref> <self/> belongs to. 
     1446        Return the :class:`Table` :var:`self` belongs to. 
    14541447        """ 
    14551448        (connection, cursor) = self.getcursor(connection) 
     
    15391532    def table(self, connection=None): 
    15401533        """ 
    1541         Return the <pyref class="Table"><class>Table</class></pyref> <self/> belongs to. 
     1534        Return the :class:`Table` :var:`self` belongs to. 
    15421535        """ 
    15431536        (connection, cursor) = self.getcursor(connection) 
     
    17131706class Argument(object): 
    17141707    """ 
    1715     <class>Argument</class> objects hold information about the arguments 
    1716     of a stored procedure. 
     1708    :class:`Argument` objects hold information about the arguments of a 
     1709    stored procedure. 
    17171710    """ 
    17181711    def __init__(self, name, position, datatype, isin, isout): 
     
    18071800    def iterarguments(self, connection=None): 
    18081801        """ 
    1809         <p>Generator that yields all <pyref class="ArgumentInfo">arguments</pyref> of the function/procedure <self/>.</p> 
     1802        Generator that yields all arguments of the function/procedure :var:`self`. 
    18101803        """ 
    18111804        (connection, cursor) = self.getcursor(connection) 
     
    18231816class Procedure(Callable): 
    18241817    """ 
    1825     Models a procedure in the database. A <class>Procedure</class> object can be 
     1818    Models a procedure in the database. A :class:`Procedure` object can be 
    18261819    used as a wrapper for calling the procedure with keyword arguments. 
    18271820    """ 
     
    18311824    def __call__(self, cursor, *args, **kwargs): 
    18321825        """ 
    1833         Call the procedure with arguments <arg>args</arg> and keyword arguments 
    1834         <arg>kwargs</arg>. <arg>cursor</arg> must be a <mod>cx_Oracle</mod> 
    1835         or <mod>ll.orasql</mod> cursor. This will return a 
    1836         <pyref class="Record"><class>Record</class></pyref> object containing 
    1837         the result of the call (i.e. this record will contain all in and out 
    1838         parameters). 
     1826        Call the procedure with arguments :var:`args` and keyword arguments 
     1827        :var:`kwargs`. :var:`cursor` must be a :mod:`cx_Oracle` or 
     1828        :mod:`ll.orasql` cursor. This will return a :class:`Record` object 
     1829        containing the result of the call (i.e. this record will contain all in 
     1830        and out parameters). 
    18391831        """ 
    18401832        self._calcargs(cursor) 
     
    18531845class Function(Callable): 
    18541846    """ 
    1855     Models a function in the database. A <class>Function</class> object can be 
     1847    Models a function in the database. A :class:`Function` object can be 
    18561848    used as a wrapper for calling the function with keyword arguments. 
    18571849    """ 
     
    18601852    def __call__(self, cursor, *args, **kwargs): 
    18611853        """ 
    1862         Call the function with arguments <arg>args</arg> and keyword arguments 
    1863         <arg>kwargs</arg>. <arg>cursor</arg> must be a <mod>cx_Oracle</mod> 
    1864         or <mod>ll.orasql</mod> cursor. This will return a tuple containing 
    1865         the result and a <pyref class="Record"><class>Record</class></pyref> object 
    1866         containing the modified parameters (i.e. this record will contain all in 
    1867         and out parameters). 
     1854        Call the function with arguments :var:`args` and keyword arguments 
     1855        :var:`kwargs`. :var:`cursor` must be a :mod:`cx_Oracle` or 
     1856        :mod:`ll.orasql` cursor. This will return a tuple containing the result 
     1857        and a :class:`Record` object containing the modified parameters (i.e. 
     1858        this record will contain all in and out parameters). 
    18681859        """ 
    18691860        self._calcargs(cursor) 
     
    19871978    def iterobjects(self, connection, schema="user"): 
    19881979        """ 
    1989         <p>Generator that yields object privileges for the current users 
    1990         (or all users) objects.</p> 
    1991         <p><arg>schema</arg> specifies which privileges should be yielded:</p> 
    1992         <dl> 
    1993         <term><lit>"user"</lit></term><item>Only object privileges for objects 
    1994         belonging to the current user will be yielded.</item> 
    1995         <term><lit>"all"</lit></term><item>All object privileges will be yielded.</item> 
    1996         </dl> 
     1980        Generator that yields object privileges for the current users (or all 
     1981        users) objects. 
     1982 
     1983        :var:`schema` specifies which privileges should be yielded: 
     1984 
     1985        ``"user"`` 
     1986            Only object privileges for objects belonging to the current user will 
     1987            be yielded. 
     1988 
     1989        ``"all"`` 
     1990            All object privileges will be yielded. 
    19971991        """ 
    19981992        if schema not in ("user", "all"): 
     
    20092003    def grantddl(self, connection=None, term=True, mapgrantee=True): 
    20102004        """ 
    2011         &sql; to grant this privilege. If <arg>mapgrantee</arg> is a list 
    2012         or a dictionary and <lit><self/>.grantee</lit> is not in this list 
    2013         (or dictionary) no command will returned. If it's a dictionary and 
    2014         <lit><self/>.grantee</lit> is in it, the privilege will be granted 
    2015         to the user specified as the value instead of the original one. If 
    2016         <lit>mapgrantee</lit> is <lit>True</lit> (the default) the privilege 
    2017         will be granted to the original grantee. 
     2005        Return SQL code to grant this privilege. If :var:`mapgrantee` is a list 
     2006        or a dictionary and ``self.grantee`` is not in this list (or dictionary) 
     2007        no command will returned. If it's a dictionary and ``self.grantee`` is 
     2008        in it, the privilege will be granted to the user specified as the value 
     2009        instead of the original one. If :var:`mapgrantee` is true (the default) 
     2010        the privilege will be granted to the original grantee. 
    20182011        """ 
    20192012        (connection, cursor) = self.getcursor(connection) 
     
    20492042    """ 
    20502043    Models a single column of a table in the database. This is used to output 
    2051     <lit>ALTER TABLE ...</lit> statements for adding, dropping and modifying 
    2052     columns. 
     2044    ``ALTER TABLE ...`` statements for adding, dropping and modifying columns. 
    20532045    """ 
    20542046    type = "column" 
     
    21792171    def datatype(self, connection=None): 
    21802172        """ 
    2181         The &sql; type of this column. 
     2173        The SQL type of this column. 
    21822174        """ 
    21832175        (connection, cursor) = self.getcursor(connection) 
     
    21872179    def default(self, connection=None): 
    21882180        """ 
    2189         The &sql; default value for this column. 
     2181        The SQL default value for this column. 
    21902182        """ 
    21912183        (connection, cursor) = self.getcursor(connection) 
  • src/ll/orasql/scripts/oracreate.py

    r182 r222  
    11#!/usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
     2# -*- coding: utf-8 -*- 
    33 
    4 ## Copyright 2005-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 2005-2007 by Walter Dörwald 
     4## Copyright 2005-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 2005-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved 
  • src/ll/orasql/scripts/oradiff.py

    r186 r222  
    11#!/usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
    3  
    4 ## Copyright 2005-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 2005-2007 by Walter Dörwald 
     2# -*- coding: utf-8 -*- 
     3 
     4## Copyright 2005-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 2005-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved 
  • src/ll/orasql/scripts/oradrop.py

    r182 r222  
    11#!/usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
     2# -*- coding: utf-8 -*- 
    33 
    4 ## Copyright 2005-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 2005-2007 by Walter Dörwald 
     4## Copyright 2005-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 2005-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved 
  • src/ll/orasql/scripts/oragrant.py

    r186 r222  
    11#!/usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
     2# -*- coding: utf-8 -*- 
    33 
    4 ## Copyright 2005-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 2005-2007 by Walter Dörwald 
     4## Copyright 2005-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 2005-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved 
  • src/ll/orasql/scripts/oramerge.py

    r182 r222  
    11#!/usr/bin/env python 
    2 # -*- coding: iso-8859-1 -*- 
    3  
    4 ## Copyright 2005-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 2005-2007 by Walter Dörwald 
     2# -*- coding: utf-8 -*- 
     3 
     4## Copyright 2005-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 2005-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved 
  • test/test_orasql.py

    r188 r222  
    11#! /usr/bin/env/python 
    2 # -*- coding: iso-8859-1 -*- 
    3  
    4 ## Copyright 2004-2007 by LivingLogic AG, Bayreuth/Germany. 
    5 ## Copyright 2004-2007 by Walter Dörwald 
     2# -*- coding: utf-8 -*- 
     3 
     4## Copyright 2004-2008 by LivingLogic AG, Bayreuth/Germany. 
     5## Copyright 2004-2008 by Walter Dörwald 
    66## 
    77## All Rights Reserved