Changeset 4415:f8ddd9df567b in livinglogic.python.xist

Show
Ignore:
Timestamp:
03/08/11 18:51:46 (8 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Support oracle schema objects with umlauts.

Normalize names to NFC so that the roundtrip to the OS X filesystem.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/orasql/__init__.py

    r4411 r4415  
    2929 
    3030 
    31 import urllib, datetime, itertools, cStringIO, errno, fnmatch 
     31import urllib, datetime, itertools, cStringIO, errno, fnmatch, unicodedata 
    3232 
    3333from cx_Oracle import * 
     
    815815 
    816816def makeurl(name): 
    817     return urllib.pathname2url(name).replace("/", "%2f") 
     817    return urllib.pathname2url(name.encode("utf-8")).replace("/", "%2f") 
    818818 
    819819 
     
    19411941    def fixname(cls, name, code): 
    19421942        code = code.split(None, 6) 
    1943         code = u"create or replace force view {} {}".format(getfullname(name), code[6]) 
     1943        code = u"create or replace force view {} {}".format(getfullname(name, None), code[6]) 
    19441944        return code 
    19451945 
     
    27102710            if name.lower().endswith(".sql"): 
    27112711                name = name[:-4] 
     2712            name = unicodedata.normalize('NFC', name) 
    27122713            code = Object.name2type[type](name).createddl(self.connection.dbconnection, term=False) 
    27132714            self.stream = cStringIO.StringIO(code.encode("utf-8")) 
     
    27402741                if name.lower().endswith(".sql"): 
    27412742                    name = name[:-4] 
     2743                name = unicodedata.normalize('NFC', name) 
    27422744                code = self.stream.getvalue().decode("utf-8") 
    27432745                code = type.fixname(name, code)