2003-05-14 02:20:58 +05:30
|
|
|
# -*- python -*-
|
2003-08-15 04:03:30 +05:30
|
|
|
#
|
2002-10-20 19:55:16 +05:30
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
2006-03-03 05:07:16 +05:30
|
|
|
# Copyright (C) 2000-2006 Donald N. Allingham
|
2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
2007-09-08 11:24:02 +05:30
|
|
|
# This program is distributed in the hope that it will be useful,
|
2002-10-20 19:55:16 +05:30
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
2004-01-10 04:35:06 +05:30
|
|
|
# $Id$
|
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
"""
|
|
|
|
Provides constants for other modules
|
|
|
|
"""
|
|
|
|
|
2005-08-25 20:38:07 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2006-03-01 10:38:11 +05:30
|
|
|
# Standard python modules
|
2005-08-25 20:38:07 +05:30
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2006-03-01 10:38:11 +05:30
|
|
|
import os
|
2008-05-08 17:38:19 +05:30
|
|
|
import sys
|
2006-10-27 23:07:08 +05:30
|
|
|
from gettext import gettext as _
|
2005-08-25 20:38:07 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2006-03-01 10:38:11 +05:30
|
|
|
# Standard GRAMPS Websites
|
2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2007-09-08 11:24:02 +05:30
|
|
|
URL_HOMEPAGE = "http://gramps-project.org/"
|
|
|
|
URL_MAILINGLIST = "http://sourceforge.net/mail/?group_id=25770"
|
|
|
|
URL_BUGTRACKER = "http://bugs.gramps-project.org/bug_report_advanced_page.php"
|
2008-01-12 20:54:19 +05:30
|
|
|
URL_WIKISTRING = "http://gramps-project.org/wiki/index.php?title="
|
2009-01-20 18:26:28 +05:30
|
|
|
URL_MANUAL_PAGE = "Gramps_3.1_Wiki_Manual"
|
2008-01-15 23:29:56 +05:30
|
|
|
WIKI_FAQ = "FAQ"
|
2009-01-20 18:26:28 +05:30
|
|
|
WIKI_KEYBINDINGS = "Gramps_3.1_Wiki_Manual_-_Keybindings"
|
|
|
|
WIKI_EXTRAPLUGINS= "3.1.x_Third-party_Plugins"
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2004-08-07 10:46:57 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Mime Types
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2007-12-29 20:17:38 +05:30
|
|
|
APP_FAMTREE = 'x-directory/normal'
|
2007-09-08 11:24:02 +05:30
|
|
|
APP_GRAMPS = "application/x-gramps"
|
|
|
|
APP_GRAMPS_XML = "application/x-gramps-xml"
|
|
|
|
APP_GEDCOM = "application/x-gedcom"
|
|
|
|
APP_GRAMPS_PKG = "application/x-gramps-package"
|
|
|
|
APP_GENEWEB = "application/x-geneweb"
|
|
|
|
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
|
2004-08-07 10:46:57 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2007-09-08 11:24:02 +05:30
|
|
|
# system paths
|
2002-10-20 19:55:16 +05:30
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2007-09-08 11:24:02 +05:30
|
|
|
PREFIXDIR = "@prefix@"
|
|
|
|
SYSCONFDIR = "@sysconfdir@"
|
2005-01-06 22:58:31 +05:30
|
|
|
|
2006-03-21 11:53:45 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Determine the home directory. According to Wikipedia, most UNIX like
|
|
|
|
# systems use HOME. I'm assuming that this would apply to OS X as well.
|
|
|
|
# Windows apparently uses USERPROFILE
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2008-02-26 03:32:01 +05:30
|
|
|
if os.environ.has_key('GRAMPSHOME'):
|
|
|
|
USER_HOME = os.environ['GRAMPSHOME']
|
|
|
|
HOME_DIR = os.path.join(USER_HOME, 'gramps')
|
|
|
|
elif os.environ.has_key('USERPROFILE'):
|
2007-09-08 11:24:02 +05:30
|
|
|
USER_HOME = os.environ['USERPROFILE']
|
2007-12-25 11:24:41 +05:30
|
|
|
if os.environ.has_key('APPDATA'):
|
|
|
|
HOME_DIR = os.path.join(os.environ['APPDATA'], 'gramps')
|
|
|
|
else:
|
|
|
|
HOME_DIR = os.path.join(USER_HOME, 'gramps')
|
2006-08-21 03:22:49 +05:30
|
|
|
else:
|
2007-09-08 11:24:02 +05:30
|
|
|
USER_HOME = os.environ['HOME']
|
|
|
|
HOME_DIR = os.path.join(USER_HOME, '.gramps')
|
2006-03-21 11:53:45 +05:30
|
|
|
|
2002-10-20 19:55:16 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Paths to files - assumes that files reside in the same directory as
|
|
|
|
# this one, and that the plugins directory is in a directory below this.
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2008-05-08 17:38:19 +05:30
|
|
|
# test for sys.frozen to detect a py2exe executable on Windows
|
|
|
|
if hasattr(sys, "frozen"):
|
|
|
|
ROOT_DIR = os.path.abspath(os.path.dirname(
|
|
|
|
unicode(sys.executable, sys.getfilesystemencoding())))
|
|
|
|
else:
|
|
|
|
ROOT_DIR = os.path.abspath(os.path.dirname(
|
|
|
|
unicode(__file__, sys.getfilesystemencoding())))
|
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
IMAGE_DIR = os.path.join(ROOT_DIR, "images")
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
CUSTOM_FILTERS = os.path.join(HOME_DIR, "custom_filters.xml")
|
|
|
|
REPORT_OPTIONS = os.path.join(HOME_DIR, "report_options.xml")
|
|
|
|
TOOL_OPTIONS = os.path.join(HOME_DIR, "tool_options.xml")
|
2007-11-26 10:41:19 +05:30
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
ENV_DIR = os.path.join(HOME_DIR, "env")
|
2007-11-26 10:41:19 +05:30
|
|
|
TEMP_DIR = os.path.join(HOME_DIR, "temp")
|
2009-06-06 15:19:40 +05:30
|
|
|
THUMB_DIR = os.path.join(HOME_DIR, "thumb")
|
|
|
|
USER_PLUGINS = os.path.join(HOME_DIR, "plugins")
|
2007-11-26 10:41:19 +05:30
|
|
|
# dirs checked/made for each Gramps session
|
|
|
|
USER_DIRLIST = (HOME_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR,
|
2009-06-11 11:58:51 +05:30
|
|
|
USER_PLUGINS)
|
2006-03-05 04:23:46 +05:30
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
ICON = os.path.join(ROOT_DIR, "images", "gramps.png")
|
|
|
|
LOGO = os.path.join(ROOT_DIR, "images", "logo.png")
|
|
|
|
SPLASH = os.path.join(ROOT_DIR, "images", "splash.jpg")
|
|
|
|
LICENSE_FILE = os.path.join(ROOT_DIR, "COPYING")
|
2006-03-05 04:23:46 +05:30
|
|
|
|
|
|
|
#
|
|
|
|
# Glade files
|
|
|
|
#
|
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
GLADE_DIR = os.path.join(ROOT_DIR, "glade")
|
|
|
|
GLADE_FILE = os.path.join(GLADE_DIR, "gramps.glade")
|
|
|
|
PERSON_GLADE = os.path.join(GLADE_DIR, "edit_person.glade")
|
|
|
|
PLUGINS_GLADE = os.path.join(GLADE_DIR, "plugins.glade")
|
|
|
|
MERGE_GLADE = os.path.join(GLADE_DIR, "mergedata.glade")
|
|
|
|
RULE_GLADE = os.path.join(GLADE_DIR, "rule.glade")
|
|
|
|
|
2006-03-03 05:47:58 +05:30
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
|
|
|
|
DATA_DIR = os.path.join(ROOT_DIR, "data")
|
|
|
|
SYSTEM_FILTERS = os.path.join(DATA_DIR, "system_filters.xml")
|
|
|
|
TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
|
2006-03-05 04:23:46 +05:30
|
|
|
|
2007-09-28 17:54:27 +05:30
|
|
|
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
USE_TIPS = False
|
2006-03-21 11:53:45 +05:30
|
|
|
|
2006-08-26 08:16:40 +05:30
|
|
|
if os.sys.platform == "win32":
|
2007-09-08 11:24:02 +05:30
|
|
|
USE_THUMBNAILER = False
|
2006-08-26 08:16:40 +05:30
|
|
|
else:
|
2007-09-08 11:24:02 +05:30
|
|
|
USE_THUMBNAILER = True
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# About box information
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2007-09-08 11:24:02 +05:30
|
|
|
PROGRAM_NAME = "GRAMPS"
|
|
|
|
VERSION = "@VERSIONSTRING@"
|
2008-05-06 09:25:02 +05:30
|
|
|
COPYRIGHT_MSG = u"\u00A9 2001-2006 Donald N. Allingham\n" \
|
2009-03-01 18:34:11 +05:30
|
|
|
u"\u00A9 2007-2009 The GRAMPS Developers"
|
2007-09-08 11:24:02 +05:30
|
|
|
COMMENTS = _("GRAMPS (Genealogical Research and Analysis "
|
2006-03-21 11:53:45 +05:30
|
|
|
"Management Programming System) is a personal "
|
|
|
|
"genealogy program.")
|
2007-09-08 11:24:02 +05:30
|
|
|
AUTHORS = [
|
2009-03-11 17:21:56 +05:30
|
|
|
"Alexander Roitman",
|
|
|
|
"Benny Malengier",
|
|
|
|
"Brian Matherly",
|
|
|
|
"Donald A. Peterson",
|
2007-09-08 11:24:02 +05:30
|
|
|
"Donald N. Allingham",
|
2009-03-11 17:21:56 +05:30
|
|
|
"David Hampton",
|
2007-09-08 11:24:02 +05:30
|
|
|
"Martin Hawlisch",
|
2009-03-11 17:21:56 +05:30
|
|
|
"Richard Taylor",
|
2007-09-08 11:24:02 +05:30
|
|
|
"Tim Waugh",
|
2003-02-14 09:25:20 +05:30
|
|
|
]
|
2008-04-07 02:05:38 +05:30
|
|
|
|
2008-05-07 14:21:57 +05:30
|
|
|
AUTHORS_FILE = os.path.join(DATA_DIR, "authors.xml")
|
2003-02-14 09:25:20 +05:30
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
DOCUMENTERS = [
|
|
|
|
'Alexander Roitman',
|
2003-02-14 09:25:20 +05:30
|
|
|
]
|
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
TRANSLATORS = _('TRANSLATORS: Translate this to your '
|
|
|
|
'name in your native language')
|
2002-10-20 19:55:16 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Constants
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2007-09-08 11:24:02 +05:30
|
|
|
THUMBSCALE = 96.0
|
|
|
|
XMLFILE = "data.gramps"
|
2008-01-18 23:58:28 +05:30
|
|
|
NO_SURNAME = "(%s)" % _("none")
|
|
|
|
NO_GIVEN = "(%s)" % _("none")
|
2002-10-20 19:55:16 +05:30
|
|
|
|
2009-07-04 15:00:10 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Platforms
|
|
|
|
# Never test on LINUX, handle Linux in the else statement as default
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
LINUX = ["Linux", "linux"]
|
|
|
|
MACOS = ["Darwin", "darwin"]
|
|
|
|
WINDOWS = ["Windows", "win32"]
|
|
|
|
|
2003-05-17 09:44:13 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Options Constants
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2008-11-29 00:51:20 +05:30
|
|
|
# Note: Make sure to edit ArgHandler.py _help string too!
|
2004-06-21 10:40:27 +05:30
|
|
|
# (longName, shortName, type , default, flags, descrip , argDescrip)
|
2007-09-08 11:24:02 +05:30
|
|
|
POPT_TABLE = [
|
2008-01-01 14:51:00 +05:30
|
|
|
("open", 'O', str, None, 0, "Open family tree", "FAMILY_TREE"),
|
2007-09-08 11:24:02 +05:30
|
|
|
("import", 'i', str, None, 0, "Import file", "FILENAME"),
|
2008-11-29 00:51:20 +05:30
|
|
|
("export", 'e', str, None, 0, "Export file", "FILENAME"),
|
2007-09-08 11:24:02 +05:30
|
|
|
("format", 'f', str, None, 0, 'Specify format', "FORMAT"),
|
|
|
|
("action", 'a', str, None, 0, 'Specify action', "ACTION"),
|
|
|
|
("options", 'p', str, None, 0, 'Specify options', "OPTIONS_STRING"),
|
|
|
|
("debug", 'd', str, None, 0, 'Enable debug logs', "LOGGER_NAME"),
|
2008-01-28 16:46:54 +05:30
|
|
|
("", 'l', None, None, 0, 'List Family Trees', ""),
|
2008-11-29 00:51:20 +05:30
|
|
|
("", 'L', None, None, 0, 'List Family Tree Details', ""),
|
2008-01-28 16:46:54 +05:30
|
|
|
("force-unlock", 'u', None, None, 0, 'Force unlock of family tree', ""),
|
2004-06-21 10:40:27 +05:30
|
|
|
]
|
|
|
|
|
2007-09-08 11:24:02 +05:30
|
|
|
LONGOPTS = [
|
2008-01-01 14:51:00 +05:30
|
|
|
"action=",
|
|
|
|
"class=",
|
|
|
|
"debug=",
|
|
|
|
"display=",
|
2007-09-08 11:24:02 +05:30
|
|
|
"disable-sound",
|
2008-01-01 14:51:00 +05:30
|
|
|
"disable-crash-dialog",
|
|
|
|
"enable-sound",
|
|
|
|
"espeaker=",
|
2009-03-11 17:21:56 +05:30
|
|
|
"export=",
|
2008-01-28 16:46:54 +05:30
|
|
|
"force-unlock",
|
2008-01-01 14:51:00 +05:30
|
|
|
"format=",
|
2004-06-21 10:40:27 +05:30
|
|
|
"gdk-debug=",
|
2007-09-08 11:24:02 +05:30
|
|
|
"gdk-no-debug=",
|
2004-06-21 10:40:27 +05:30
|
|
|
"gtk-debug=",
|
2007-09-08 11:24:02 +05:30
|
|
|
"gtk-no-debug=",
|
|
|
|
"gtk-module=",
|
2008-01-01 14:51:00 +05:30
|
|
|
"g-fatal-warnings",
|
|
|
|
"help",
|
|
|
|
"import=",
|
|
|
|
"load-modules=",
|
|
|
|
"list"
|
|
|
|
"name=",
|
|
|
|
"oaf-activate-iid=",
|
|
|
|
"oaf-ior-fd=",
|
|
|
|
"oaf-private",
|
|
|
|
"open=",
|
|
|
|
"options=",
|
|
|
|
"screen=",
|
2007-09-08 11:24:02 +05:30
|
|
|
"sm-client-id=",
|
|
|
|
"sm-config-prefix=",
|
2008-01-01 14:51:00 +05:30
|
|
|
"sm-disable",
|
|
|
|
"sync",
|
|
|
|
"usage",
|
|
|
|
"version",
|
2004-06-21 10:40:27 +05:30
|
|
|
]
|
2003-05-17 09:44:13 +05:30
|
|
|
|
2009-03-11 17:21:56 +05:30
|
|
|
SHORTOPTS = "O:i:e:f:a:p:d:lLhu?"
|
2003-05-17 09:44:13 +05:30
|
|
|
|
2008-05-08 17:38:19 +05:30
|
|
|
|