Changeset 4411:78abbc41033a in livinglogic.python.xist

Show
Ignore:
Timestamp:
03/08/11 15:12:40 (9 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add .sql extension to oracle URLs.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r4407 r4411  
    1515    and :option:`--exclude` for including/excluding URLs that match a regular 
    1616    expression. They also have an new option :option:`--all` to include/exclude 
    17     dot files (i.e. files whose name starts with a dot) 
     17    dot files (i.e. files/directories whose name starts with a dot) 
    1818 
    1919*   ``ucp`` now supports to new options :option:`--padding` and 
     
    2929 
    3030*   :mod:`ll.xist.ns.rest` now handles option lists. 
     31 
     32*   The Oracle URLs provided by :mod:`ll.orasql` now have a ``.sql`` extension 
     33    for all schema objects. On writing a ``.sql`` extension will be stripped to 
     34    get the name of the schema object. 
    3135 
    3236 
  • src/ll/orasql/__init__.py

    r4386 r4411  
    26662666                names = (name[0] for name in Object.name2type[type].iternames(self.dbconnection, "user") if name[1] is None) 
    26672667                if len(path) == 1: 
    2668                     result = [url_.URL(u"{}/{}".format(type, makeurl(name))) for name in names] 
     2668                    result = [url_.URL(u"{}/{}.sql".format(type, makeurl(name))) for name in names] 
    26692669                else: 
    2670                     result = [url_.URL(makeurl(name)) for name in names] 
     2670                    result = [url_.URL(u"{}.sql".format(makeurl(name))) for name in names] 
    26712671        else: 
    26722672            raise IOError(errno.ENOTDIR, "Not a directory: {}".format(url)) 
     
    27082708        else: 
    27092709            name = url.path[1] 
     2710            if name.lower().endswith(".sql"): 
     2711                name = name[:-4] 
    27102712            code = Object.name2type[type](name).createddl(self.connection.dbconnection, term=False) 
    27112713            self.stream = cStringIO.StringIO(code.encode("utf-8")) 
     
    27362738                type = Object.name2type[self.url.path[0]] 
    27372739                name = self.url.path[1] 
     2740                if name.lower().endswith(".sql"): 
     2741                    name = name[:-4] 
    27382742                code = self.stream.getvalue().decode("utf-8") 
    27392743                code = type.fixname(name, code)