Move images and data directories. Also svn version code from r20919.

svn: r20990
This commit is contained in:
Nick Hall 2013-01-04 23:46:24 +00:00
parent 81e1237b3c
commit bb9601a2a0
318 changed files with 116 additions and 129 deletions

View File

@ -43,6 +43,7 @@ import uuid
#
#-------------------------------------------------------------------------
from .ggettext import sgettext as _
from .svn_revision import get_svn_revision
#-------------------------------------------------------------------------
#
@ -50,11 +51,12 @@ from .ggettext import sgettext as _
#
#-------------------------------------------------------------------------
PROGRAM_NAME = "Gramps"
if "@VERSIONSTRING@" == "@" + "VERSIONSTRING" + "@":
VERSION = "4.0.0"
else:
VERSION = "@VERSIONSTRING@"
VERSION_TUPLE = (4, 0, 0)
VERSION = "@VERSIONSTRING@"
if VERSION == "@" + "VERSIONSTRING" + "@":
raise Exception("Please run 'python setup.py build'")
VERSION_TUPLE = tuple(map(int, VERSION.split(".")))
major_version = "%s.%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1])
VERSION += get_svn_revision()
#-------------------------------------------------------------------------
#
@ -65,11 +67,11 @@ 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"
URL_WIKISTRING = "http://gramps-project.org/wiki/index.php?title="
URL_MANUAL_PAGE = "Gramps_4.0_Wiki_Manual"
URL_MANUAL_PAGE = "Gramps_%s_Wiki_Manual" % major_version
WIKI_FAQ = "FAQ"
WIKI_KEYBINDINGS = "Gramps_4.0_Wiki_Manual_-_Keybindings"
WIKI_EXTRAPLUGINS= "4.0_Addons"
WIKI_EXTRAPLUGINS_RAWDATA = "Plugins4.0&action=raw"
WIKI_KEYBINDINGS = "Gramps_%s_Wiki_Manual_-_Keybindings" % major_version
WIKI_EXTRAPLUGINS= "%s_Addons" % major_version
WIKI_EXTRAPLUGINS_RAWDATA = "Plugins%s&action=raw" % major_version
#-------------------------------------------------------------------------
#
@ -84,13 +86,6 @@ APP_GRAMPS_PKG = "application/x-gramps-package"
APP_GENEWEB = "application/x-geneweb"
APP_VCARD = ["text/x-vcard", "text/x-vcalendar"]
#-------------------------------------------------------------------------
#
# system paths
#
#-------------------------------------------------------------------------
LOCALE_DIR = "@LOCALE_DIR@"
#-------------------------------------------------------------------------
#
# Platforms
@ -133,24 +128,6 @@ if sys.version_info[0] < 3:
else:
pass
#-------------------------------------------------------------------------
#
# 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.
#
#-------------------------------------------------------------------------
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
__file__), os.pardir))
if sys.version_info[0] < 3:
# 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.join(os.path.dirname(
unicode(__file__, sys.getfilesystemencoding())), os.pardir))
IMAGE_DIR = os.path.join(ROOT_DIR, "images")
VERSION_DIR = os.path.join(
HOME_DIR, "gramps%s%s" % (VERSION_TUPLE[0], VERSION_TUPLE[1]))
@ -168,15 +145,26 @@ USER_PLUGINS = os.path.join(VERSION_DIR, "plugins")
USER_DIRLIST = (HOME_DIR, VERSION_DIR, ENV_DIR, TEMP_DIR, THUMB_DIR,
THUMB_NORMAL, THUMB_LARGE, USER_PLUGINS)
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")
#-------------------------------------------------------------------------
#
# Paths to python modules - assumes that the root directory is one level
# above this one, and that the plugins directory is below the root directory.
#
#-------------------------------------------------------------------------
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(
__file__), os.pardir))
if sys.version_info[0] < 3:
# 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.join(os.path.dirname(
unicode(__file__, sys.getfilesystemencoding())), os.pardir))
#
# Glade files
#
GLADE_DIR = os.path.join(ROOT_DIR, "gui", "glade")
GLADE_FILE = os.path.join(GLADE_DIR, "gramps.glade")
PERSON_GLADE = os.path.join(GLADE_DIR, "edit_person.glade")
@ -186,22 +174,43 @@ RULE_GLADE = os.path.join(GLADE_DIR, "rule.glade")
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
DATA_DIR = os.path.join(ROOT_DIR, "data")
WEB_DIR = os.path.join(ROOT_DIR, 'webapp')
#SYSTEM_FILTERS = os.path.join(DATA_DIR, "system_filters.xml")
TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
WEBSTUFF_DIR = os.path.join(PLUGINS_DIR, "webstuff")
WEBSTUFF_IMAGE_DIR = os.path.join(WEBSTUFF_DIR, "images")
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
USE_TIPS = False
USE_TIPS = False
if os.sys.platform in WINDOWS:
USE_THUMBNAILER = False
else:
USE_THUMBNAILER = True
#-------------------------------------------------------------------------
#
# Paths to data files.
#
#-------------------------------------------------------------------------
SHARE_DIR = "@SHARE_DIR@"
LOCALE_DIR = "@LOCALE_DIR@"
if SHARE_DIR != '':
DATA_DIR = os.path.join(SHARE_DIR, 'gramps')
IMAGE_DIR = os.path.join(SHARE_DIR, 'gramps', 'icons', 'hicolor')
DOC_DIR = os.path.join(SHARE_DIR, 'doc', 'gramps')
else:
DATA_DIR = 'data'
IMAGE_DIR = 'images'
DOC_DIR = os.curdir
TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
ICON = os.path.join(IMAGE_DIR, "gramps.png")
LOGO = os.path.join(IMAGE_DIR, "logo.png")
SPLASH = os.path.join(IMAGE_DIR, "splash.jpg")
LICENSE_FILE = os.path.join(DOC_DIR, 'COPYING')
#-------------------------------------------------------------------------
#
# About box information

View File

@ -0,0 +1,42 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# 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
#
# $Id$
import sys
import subprocess
if sys.version_info[0] < 3:
cuni = unicode
else:
def to_utf8(s):
return s.decode("utf-8")
cuni = to_utf8
def get_svn_revision(path=""):
stdout = ""
try:
p = subprocess.Popen("svnversion -n \"%s\"" % path, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate()
except:
pass
return "-r" + cuni(stdout) if stdout else ""

View File

@ -1,67 +0,0 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# 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
#
# $Id$
"""
Based on the version from Django, a Python ORM.
"""
import re
import os
from ..constfunc import cuni
def get_svn_revision(path=None):
"""
Returns the SVN revision in the form SVN-XXXX,
where XXXX is the revision number.
Returns "" if anything goes wrong, such as an unexpected
format of internal SVN files.
If path is provided, it should be a directory whose SVN info you
want to inspect. If it's not provided, this will use the directory
where this file resides.
"""
rev = None
if path is None:
path = os.path.dirname(__file__)
entries_path = '%s/.svn/entries' % path
try:
entries = open(entries_path, 'r').read()
except IOError:
pass
else:
# Versions >= 7 of the entries file are flat text. The first line is
# the version number. The next set of digits after 'dir' is the revision
if re.match('(\d+)', entries):
rev_match = re.search('\d+\s+dir\s+(\d+)', entries)
if rev_match:
rev = rev_match.groups()[0]
# Older XML versions of the file specify revision as an attribute of
# the first entries node.
else:
from xml.dom import minidom
dom = minidom.parse(entries_path)
rev = dom.getElementsByTagName('entry')[0].getAttribute('revision')
if rev:
return cuni('SVN-%s' % rev)
return cuni('')

View File

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 816 B

View File

Before

Width:  |  Height:  |  Size: 835 B

After

Width:  |  Height:  |  Size: 835 B

View File

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 851 B

View File

Before

Width:  |  Height:  |  Size: 885 B

After

Width:  |  Height:  |  Size: 885 B

View File

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 812 B

View File

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B

View File

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 857 B

View File

Before

Width:  |  Height:  |  Size: 916 B

After

Width:  |  Height:  |  Size: 916 B

View File

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 530 B

View File

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 732 B

View File

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 675 B

View File

Before

Width:  |  Height:  |  Size: 772 B

After

Width:  |  Height:  |  Size: 772 B

View File

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 777 B

View File

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 633 B

View File

Before

Width:  |  Height:  |  Size: 908 B

After

Width:  |  Height:  |  Size: 908 B

View File

Before

Width:  |  Height:  |  Size: 804 B

After

Width:  |  Height:  |  Size: 804 B

View File

Before

Width:  |  Height:  |  Size: 885 B

After

Width:  |  Height:  |  Size: 885 B

View File

Before

Width:  |  Height:  |  Size: 604 B

After

Width:  |  Height:  |  Size: 604 B

View File

Before

Width:  |  Height:  |  Size: 808 B

After

Width:  |  Height:  |  Size: 808 B

View File

Before

Width:  |  Height:  |  Size: 972 B

After

Width:  |  Height:  |  Size: 972 B

View File

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 920 B

View File

Before

Width:  |  Height:  |  Size: 927 B

After

Width:  |  Height:  |  Size: 927 B

View File

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 798 B

View File

Before

Width:  |  Height:  |  Size: 799 B

After

Width:  |  Height:  |  Size: 799 B

View File

Before

Width:  |  Height:  |  Size: 778 B

After

Width:  |  Height:  |  Size: 778 B

View File

Before

Width:  |  Height:  |  Size: 945 B

After

Width:  |  Height:  |  Size: 945 B

View File

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 715 B

View File

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 642 B

View File

Before

Width:  |  Height:  |  Size: 823 B

After

Width:  |  Height:  |  Size: 823 B

View File

Before

Width:  |  Height:  |  Size: 703 B

After

Width:  |  Height:  |  Size: 703 B

View File

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 574 B

View File

Before

Width:  |  Height:  |  Size: 892 B

After

Width:  |  Height:  |  Size: 892 B

View File

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 895 B

View File

Before

Width:  |  Height:  |  Size: 857 B

After

Width:  |  Height:  |  Size: 857 B

View File

Before

Width:  |  Height:  |  Size: 782 B

After

Width:  |  Height:  |  Size: 782 B

View File

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 809 B

View File

Before

Width:  |  Height:  |  Size: 928 B

After

Width:  |  Height:  |  Size: 928 B

View File

Before

Width:  |  Height:  |  Size: 975 B

After

Width:  |  Height:  |  Size: 975 B

View File

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 485 B

View File

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

View File

Before

Width:  |  Height:  |  Size: 636 B

After

Width:  |  Height:  |  Size: 636 B

View File

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 759 B

View File

Before

Width:  |  Height:  |  Size: 747 B

After

Width:  |  Height:  |  Size: 747 B

View File

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 681 B

View File

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 816 B

View File

Before

Width:  |  Height:  |  Size: 555 B

After

Width:  |  Height:  |  Size: 555 B

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

View File

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 753 B

View File

Before

Width:  |  Height:  |  Size: 647 B

After

Width:  |  Height:  |  Size: 647 B

View File

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

View File

Before

Width:  |  Height:  |  Size: 820 B

After

Width:  |  Height:  |  Size: 820 B

View File

Before

Width:  |  Height:  |  Size: 775 B

After

Width:  |  Height:  |  Size: 775 B

Some files were not shown because too many files have changed in this diff Show More