Commit Graph

616 Commits

Author SHA1 Message Date
John Ralls
b3edd2fa5f Make recentfiles.do_save exception safe. 2014-04-21 14:12:36 -07:00
John Ralls
5f3f280ea0 Fix None type exception when there's no localedir. 2014-04-21 14:08:57 -07:00
John Ralls
f0ffd6e9b9 Remove gramps.gen.utils.file.fix_encoding()
Yet another overly complicated way to spell conv_to_unicode().
Note that unicode() and str.decode() are alternate spellings of the same function in Py2, and unicode();
note as well that this was used on strings coming from the GUI or the database, not the shell, so that
using glocale.encoding was also incorrect.
2014-04-20 17:05:53 -07:00
John Ralls
55610b6f0a Remove get_unicode_path_from_env_var(), get_unicode_path_from_file_chooser()
Two very cumbersome ways of saying conv_to_unicode().
2014-04-20 17:05:53 -07:00
John Ralls
ecfad157a8 7258: Replace os.getcwd() with gramps.gen.constfunc.get_curr_dir()
Py2 on Win32 returns a str from os.getcwd(), which doesn't work with unicode in the path.
New function get_curr_dir() uses the Windows GetCurrentDirectoryW to return a Unicode.
2014-04-20 17:05:52 -07:00
John Ralls
10921cee29 GrampsLocale: Don't try to set self.localedir to _first.localedir if the latter path doesn't exist. 2014-04-20 17:05:52 -07:00
John Ralls
c1dcd6f59e 7258: Remove all instances of sys.getfilesystemencoding()
This function reliably returns a useful value only on MacOS X. On Linux it's incorrectly determined by the
locale's encoding and on Windows it always returns 'mbcs' which is correct only on FAT file systems.
2014-04-20 17:05:51 -07:00
John Ralls
efa3741579 7258: Ensure that resource paths are set correctly when they include Unicode characters. 2014-04-20 17:05:51 -07:00
John Ralls
8f4aebe4c6 7258: A consequence of forcing paths to unicode is that we sometimes need to explicitly decode a path to utf8 to pass to Gtk
Only in Py2, of course, since the Py3 version of PyGObject knows what to do.
2014-04-20 08:13:00 -07:00
Nick Hall
20c9d949ac Fix python2 bug when creating backup filename 2014-04-18 22:06:30 +01:00
John Ralls
73fed7385a 7258: Fix a path encoding issue when upgrading the database. 2014-04-15 17:05:13 -07:00
Nick Hall
f6be31eb39 Remove subversion substitution variables 2014-04-15 14:10:18 +01:00
Paul Franklin
f3e378a76a 7596: Translation of plurals does not allow the translator to omit the number 2014-04-14 19:17:26 -07:00
Paul Franklin
99cfe782da make "update_po -p" happier about unnamed strings 2014-04-14 17:07:32 -07:00
Nick Hall
4a7ae64dd3 Fix unicode error when saving filters 2014-04-13 14:03:43 +01:00
Nick Hall
0901528ddf GEPS 6: Add extra place types 2014-04-13 14:03:43 +01:00
Josip
aedfc3a673 7258: transcode os.path.join args from the fs enc to prevent a crash
fix plugin registration
fix textual, html report etc (except cairo based report)
fix web calendar report for python3
2014-04-13 10:11:22 +02:00
Paul Franklin
9c4aa37b8c 7276: translate some punctuation marks -- partial 2014-04-09 18:40:42 -07:00
Josip
6836dbd5bd git revision in windows 2014-04-09 23:09:33 +02:00
Paul Franklin
d238ad9044 make gramps XML the initial default export type 2014-04-08 19:25:13 -07:00
Josip
7fdf0f9225 7258: transcode os.path.join args from the fs enc to prevent a crash
Fix 3rd party plugin loading for Py2/Py3 in Windows when sys.path
is in Unicode or/and is not encodable in 'mbcs' encodings
2014-04-08 22:39:11 +02:00
Nick Hall
2155ae381f Remove GEPS 018 related code 2014-04-07 22:04:44 +01:00
John Ralls
43c37a603c Streamline conv_to_unicode
Also handle "None" strings and change default encoding to 'utf8' so that
it works without args when converting from UI input.
2014-04-07 13:24:11 -07:00
John Ralls
5972a3a16f 7258: Avoid dumb encoding error when compiling gpr files 2014-04-07 12:44:39 -07:00
John Ralls
dc292037e4 7588: Can not start [in Chinese on OSX]
Force UTF-8 locale on Mac
2014-04-07 11:51:02 -07:00
Josip
930a2f9819 7258: transcode os.path.join args from the fs enc to prevent a crash
:35653 rename family tree with python2
:35653 self.reference_map.delete
2014-04-07 00:17:40 +02:00
John Ralls
f201deabbc Fix up some failing tests 2014-04-06 12:56:41 -07:00
John Ralls
28505a5d8d Delete a bunch of superflous re-encodings of path names 2014-04-06 12:56:41 -07:00
Josip
fa3645bf15 7582: [Python2] Cannot remove a person having an event reference 2014-04-06 19:07:41 +02:00
Josip
f7e144f853 Change use of GetEnvironmentVariableW (#7582) 2014-04-06 00:22:32 +02:00
Josip
d2066537c7 fix recentfiles.py to work for both py2/py3 2014-04-05 01:45:36 +02:00
Josip
26ab379584 7258: transcode os.path.join args from the fs enc to prevent a crash 2014-04-04 22:05:10 +02:00
John Ralls
9550dda584 Correctly encode the contents of the lock file. 2014-04-03 15:15:19 -07:00
John Ralls
7dfb2e016f Test for ability to open a DB in an arbitrary Unicode path with a Unicode name.
And fix a couple of bugs that made the test fail.
2014-04-03 14:17:36 -07:00
Josip
91ef047766 Yet more fix of PyGObject-3.11 DeprecationWarning 2014-04-03 00:10:19 +02:00
Josip
fc40578687 Fix PyGObject-3.11 DeprecationWarning
GObject.idle_add() ==> GLib.idle_add()
2014-04-02 16:22:40 +02:00
Nick Hall
7eb68e0c2f 7559: Fix bug in abandon changes and quit 2014-03-29 19:56:58 +00:00
John Ralls
53c878aa08 Use gramps.gen.const.HOME_DIR instead of os.environ['HOME']
$HOME doesn't exist on Windows, so os.environ['HOME'] gives the wrong answer.
2014-03-27 11:34:49 -07:00
John Ralls
71650917bf 7258: Replace some os.environ['foo'] lookups missed earlier. 2014-03-27 11:32:37 -07:00
John Ralls
2a81c76e69 Prevent range error crash when loading a defective database. 2014-03-25 15:44:50 -07:00
John Ralls
97d3ab49c4 7258: Fix filesystem encoding in get_dbdir_summary and DbUndoBSDDB.close. 2014-03-25 15:44:23 -07:00
John Ralls
14e1edcd4e 7332-Filename-Decoding-Error-in-Graphical-Reports
Don't encode the filename for output. Python does that for you.
2014-03-23 15:22:46 -07:00
John Ralls
85a1c39092 7258: Transcode FS paths to avoid a crash
The problem is really that the paths get munged into strings in the
system codepage, losing or misinterpreting most Unicode. Python's os
module is smart enough to encode the unicode to the file system
encoding, but the bsddb module needs a little help.

Provide a new function, constfunc.get_env_var(name, default=None) to
cleanly import Unicode environment variables in Windows and use it in
place of all instances of foo = os.environ['BAR] or foo =
os.environ.get('BAR').

Os path functions are smart enough to convert unicode to the file system
encoding on their own, but Db functions aren't, so provide an _encode
function in gen.db.write.py and apply it where a path is being passed to
DBEnv.open().

Also convert paths from the UI to unicode from 'utf8' rather than
sysfilesystemencoding. The latter happens to be correct most of the time
on Linux and OSX but is wrong on Windows.
2014-03-23 15:09:51 -07:00
Vassilii Khachaturov
b4d2e60198 7530: gen.test.constfunc_test broken in python3
Use the `in' operator rather than has_key() method to check for
environment variables in os.environ. Works on both python2 and python3.
2014-03-18 15:48:04 +02:00
John Ralls
a030c20210 7519: GRAMPs unable to handle ... Path with accented characters
This replaces commit 8cbb3ef014 with
removing the incorrect encoding of paths with the system filesystem
encoding. Python is mostly smart enough to do that itself.

Thanks to Paul Franklin and Josip Pisoj for their help with sorting this
out.
2014-03-17 12:54:22 -07:00
John Ralls
946c5539af 7026: Eliminate localedir error message 2014-03-17 12:54:22 -07:00
Paul Franklin
471ec72966 7276: translate some punctuation marks -- partial 2014-03-17 08:03:23 -07:00
John Ralls
8cbb3ef014 7519: GRAMPs unable to handle ... Path with accented characters
Much worse, actually. Gramps wasn't able to handle any non-ascii
characters in any preference setting from Python2.

repr() in Py2 effectively runs "encode(val, ascii, backslashreplace)"
on its argument, and there's no way to reconstruct the string.
2014-03-08 17:55:50 -08:00
John Ralls
38aaa671cd Remove some left-over diagnostic messages. 2014-03-08 13:40:47 -08:00
John Ralls
49cdfe3283 Bug 6538: Collation variants do not work properly
If ICU is available, inspect the environment for $COLLATION and on
a Mac also check the AppleCollationOrder default. Pass the results
to a special ICU Locale used for sorting.
2014-03-07 16:27:05 -08:00