Changes for Gramps-Connect to work on Windows without using gramps.py
svn: r19846
This commit is contained in:
parent
c7499652d6
commit
d6f3dfb5dd
@ -85,6 +85,9 @@ if sys.platform == "win32":
|
|||||||
if sys.prefix == os.path.dirname(os.getcwd()):
|
if sys.prefix == os.path.dirname(os.getcwd()):
|
||||||
PREFIXDIR = sys.prefix
|
PREFIXDIR = sys.prefix
|
||||||
SYSCONFDIR = os.path.join(sys.prefix, "etc")
|
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:
|
elif sys.platform == "darwin" and sys.prefix != sys.exec_prefix:
|
||||||
PREFIXDIR = sys.prefix
|
PREFIXDIR = sys.prefix
|
||||||
SYSCONFDIR = os.path.join(sys.prefix, "etc")
|
SYSCONFDIR = os.path.join(sys.prefix, "etc")
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
# Gramps - a GTK+/GNOME based genealogy program
|
# Gramps - a GTK+/GNOME based genealogy program
|
||||||
#
|
#
|
||||||
# Copyright (C) 2004-2005 Donald N. Allingham
|
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -131,10 +132,10 @@ try:
|
|||||||
|
|
||||||
except:
|
except:
|
||||||
import time
|
import time
|
||||||
|
codeset = None
|
||||||
if win() or mac():
|
if win() or mac():
|
||||||
codeset = locale.getlocale()[1]
|
codeset = locale.getlocale()[1]
|
||||||
else:
|
if codeset is None:
|
||||||
codeset = locale.getpreferredencoding()
|
codeset = locale.getpreferredencoding()
|
||||||
|
|
||||||
month_to_int = {
|
month_to_int = {
|
||||||
|
@ -144,7 +144,10 @@ def probably_alive(handle):
|
|||||||
|
|
||||||
def format_number(number, with_grouping=True):
|
def format_number(number, with_grouping=True):
|
||||||
# FIXME: should be user's setting
|
# FIXME: should be user's setting
|
||||||
locale.setlocale(locale.LC_ALL, "en_US.utf8")
|
try:
|
||||||
|
locale.setlocale(locale.LC_ALL, "en_US.utf8")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if number != "":
|
if number != "":
|
||||||
return locale.format("%d", number, with_grouping)
|
return locale.format("%d", number, with_grouping)
|
||||||
else:
|
else:
|
||||||
@ -152,7 +155,10 @@ def format_number(number, with_grouping=True):
|
|||||||
|
|
||||||
def table_count(table, with_grouping=True):
|
def table_count(table, with_grouping=True):
|
||||||
# FIXME: should be user's setting
|
# FIXME: should be user's setting
|
||||||
locale.setlocale(locale.LC_ALL, "en_US.utf8")
|
try:
|
||||||
|
locale.setlocale(locale.LC_ALL, "en_US.utf8")
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if table == "person":
|
if table == "person":
|
||||||
number = models.Person.objects.count()
|
number = models.Person.objects.count()
|
||||||
elif table == "family":
|
elif table == "family":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user