[wxPython-users] ANN: GUI2Exe for wxPython :-D
roee shlomo
roee88 at gmail.com
Wed Apr 4 05:09:51 PDT 2007
One more thing,
I removed
> import sys
> reload(sys)
> sys.setdefaultencoding('utf-8')
> del sys.setdefaultencoding
And removed
> wx.SetDefaultPyEncoding("utf-8")
Replaced all encode() with encode('utf-8') and it works.
Just in case "This is *really* ugly" is really ugly.
On 4/4/07, roee shlomo <roee88 at gmail.com> wrote:
>
> Robin:
> As I mentioned before, sys.getfilesystemencoding() brings a file not found
> error.
>
> Andrea:
> in CheckForDatabase please encode configDb only when you return it.
> os.path.isdir(configDir) won't work well otherwise.
>
> > def CheckForDatabase(self):
> > """ Checks if a database exists. If it doesn't, creates one
> > anew. """
> >
> > # We build the database inside the user config folder, where we
> > # also create a sub-directory called /.GUI2Exe
> > standardPath =3D wx.StandardPaths.Get()
> > configDir =3D opj(standardPath.GetUserConfigDir () + "/.GUI2Exe=
")
> > configDb =3D opj(configDir + "/GUI2Exe_Database.db")
> >
> > if not os.path.isfile(configDb):
> > # No database
> > if not os.path.isdir(configDir):
> > # And no directory. Create a new one.
> > os.mkdir(configDir)
> >
> > return configDb.encode()
> >
> btw,
> Adding data files via GUI is not implemented yet, right?
>
> On 4/2/07, Robin Dunn <robin at alldunn.com> wrote:
> >
> > Andrea Gavana wrote:
> >
> > >> d.open(file, db.DB_BTREE, flags, mode)
> > >> UnicodeEncodeError: 'ascii' codec can't encode characters in position
> >
> > >> 26-29:
> > >> ord
> > >> inal not in range(128)
> > >>
> > >> My default system encoding is hebrew, must be something in bsddb's
> > >> unicode
> > >> support.
> > >
> > > I have no idea about that... surely Robin knows the answer, he has
> > > developed bsddb for quite long time... but maybe is just my fault, I
> > > never worked with bsddb before :-D
> >
> > It's expecting a string. When you pass a unicode object to it then
> > Python tries to coerce it to a string, using the default codec. You
> > should do the conversion yourself (probably to the
> > sys.getfilesystemencoding() encoding) before calling open.
> >
> >
> > --
> > Robin Dunn
> > Software Craftsman
> > http://wxPython.org <http://wxpython.org/> Java give you
> > jitters? Relax with wxPython!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> > For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
> >
> >
>
>
> --
> http://code.google.com/p/lh-abc
>
-- =
http://code.google.com/p/lh-abc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200704=
04/7da8c4cc/attachment.htm
More information about the wxpython-users
mailing list