[wxPython-users] ANN: GUI2Exe for wxPython :-D
roee shlomo
roee88 at gmail.com
Wed Apr 4 04:58:47 PDT 2007
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 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200704=
04/4e64bdfc/attachment.htm
More information about the wxpython-users
mailing list