how to register private python codecs?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Radovan Garabik

    how to register private python codecs?


    I am developing and application that makesheavy use of (my own)
    codecs not distributed with python (i.e. unicode(text, 'kamenicky'))
    I put the codec into file kamenicky.py, placed the file into
    /usr/lib/python/encodings,
    but now I want to distribute my application, and I assume that
    users won't always have the possibility of copying files into
    /usr/lib/python/encodings.
    Is there a (simple) way how to register this encoding so that the
    file "kamenicky. py" can be in (let's say) current directory?

    TIA

    --
    -----------------------------------------------------------
    | Radovan GarabĂ­k http://melkor.dnp.fmph.uniba.sk/~garabik/ |
    | __..--^^^--..__ garabik @ kassiopeia.juls .savba.sk |
    -----------------------------------------------------------
    Antivirus alert: file .signature infected by signature virus.
    Hi! I'm a signature virus! Copy me into your signature file to help me spread!
  • Steven Taschuk

    #2
    Re: how to register private python codecs?

    Quoth Radovan Garabik:
    [...][color=blue]
    > Is there a (simple) way how to register this encoding so that the
    > file "kamenicky. py" can be in (let's say) current directory?[/color]

    See codecs.register ().

    --
    Steven Taschuk Aral: "Confusion to the enemy, boy."
    staschuk@telusp lanet.net Mark: "Turn-about is fair play, sir."
    -- _Mirror Dance_, Lois McMaster Bujold

    Comment

    Working...