Changes for Gramps-Connect to work on Windows without using gramps.py

svn: r19846
This commit is contained in:
Doug Blank 2012-06-15 19:52:33 +00:00
parent c7499652d6
commit d6f3dfb5dd
3 changed files with 14 additions and 4 deletions

View File

@ -85,6 +85,9 @@ if sys.platform == "win32":
if sys.prefix == os.path.dirname(os.getcwd()):
PREFIXDIR = sys.prefix
SYSCONFDIR = os.path.join(sys.prefix, "etc")
else:
PREFIXDIR = os.path.dirname(__file__)
SYSCONFDIR = os.path.join(PREFIXDIR, "etc")
elif sys.platform == "darwin" and sys.prefix != sys.exec_prefix:
PREFIXDIR = sys.prefix
SYSCONFDIR = os.path.join(sys.prefix, "etc")

View File

@ -3,6 +3,7 @@
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2005 Donald N. Allingham
# Copyright (C) 2012 Doug Blank <doug.blank@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -131,10 +132,10 @@ try:
except:
import time
codeset = None
if win() or mac():
codeset = locale.getlocale()[1]
else:
if codeset is None:
codeset = locale.getpreferredencoding()
month_to_int = {

View File

@ -144,7 +144,10 @@ def probably_alive(handle):
def format_number(number, with_grouping=True):
# FIXME: should be user's setting
try:
locale.setlocale(locale.LC_ALL, "en_US.utf8")
except:
pass
if number != "":
return locale.format("%d", number, with_grouping)
else:
@ -152,7 +155,10 @@ def format_number(number, with_grouping=True):
def table_count(table, with_grouping=True):
# FIXME: should be user's setting
try:
locale.setlocale(locale.LC_ALL, "en_US.utf8")
except:
pass
if table == "person":
number = models.Person.objects.count()
elif table == "family":