2007-07-22 Don Allingham <don@gramps-project.org>

* configure.in: remove gconf requirement
	* src/Config/_GrampsConfigKeys.py: pylint
	* src/Config/__init__.py: drop gconf, provide upgrade to .ini
	* src/Config/_GrampsGconfKeys.py: pylint
	* src/Config/_GrampsIniKeys.py: pylint
	* src/plugins/ExtractCity.py: fix name
	* src/plugins/EventNames.py: fix name
	* src/Spell.py: pylint
	* data/Makefile.am: remove gconf schema installation



svn: r8755
This commit is contained in:
Don Allingham 2007-07-22 21:03:52 +00:00
parent 6bf7eb10c6
commit abf7019a63
12 changed files with 305 additions and 356 deletions

View File

@ -1,3 +1,14 @@
2007-07-22 Don Allingham <don@gramps-project.org>
* configure.in: remove gconf requirement
* src/Config/_GrampsConfigKeys.py: pylint
* src/Config/__init__.py: drop gconf, provide upgrade to .ini
* src/Config/_GrampsGconfKeys.py: pylint
* src/Config/_GrampsIniKeys.py: pylint
* src/plugins/ExtractCity.py: fix name
* src/plugins/EventNames.py: fix name
* src/Spell.py: pylint
* data/Makefile.am: remove gconf schema installation
2007-07-21 Don Allingham <don@gramps-project.org>
* src/plugins/ExtractCity.py: improved extraction, fix registration
* src/plugins/EventNames.py: fix registration

32
config.guess vendored
View File

@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2007-03-06'
timestamp='2006-07-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -161,7 +161,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@ -781,7 +780,7 @@ EOF
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW*:*)
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
@ -791,15 +790,12 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
x86:Interix*:[3456]*)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T:Interix*:[3456]*)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
@ -954,9 +950,6 @@ EOF
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa:Linux:*:*)
echo xtensa-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@ -1215,15 +1208,6 @@ EOF
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;

16
config.sub vendored
View File

@ -4,7 +4,7 @@
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2007-01-18'
timestamp='2006-09-20'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -245,12 +245,12 @@ case $basic_machine in
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fido | fr30 | frv \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep \
| maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -324,7 +324,7 @@ case $basic_machine in
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
@ -925,9 +925,6 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
@ -1222,7 +1219,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
| -skyos* | -haiku* | -rdos* | -toppers*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1417,9 +1414,6 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;

View File

@ -25,13 +25,6 @@ ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
AC_PROG_INTLTOOL
dnl Checking for gconftool-2
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
if test "x$GCONFTOOL" = xno; then
AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
fi
AM_GCONF2_REPLACEMENT
AM_SHARED_MIME
AM_PACKAGER
dnl This is a hack to disable scrollkeeper update when in the packager mode.
@ -52,9 +45,9 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the Gettext pa
AM_GLIB_GNU_GETTEXT
dnl Checks for programs.
dnl We first only check for python >= 2.3
dnl We first only check for python >= 2.4
AM_PATH_PYTHON(2.3)
AM_PATH_PYTHON(2.4)
AC_PATH_PROG(BINSH, sh)
pygtk_require="
@ -120,28 +113,6 @@ then
fi
AC_MSG_RESULT($has_pygnome)
AC_MSG_CHECKING(Python bindings for gconf)
cat > conftest.py <<EOF
$pygtk_require
try:
import gconf
out("gconf")
except ImportError:
import gnome.gconf
out("gnome.gconf")
except ImportError:
out("NO")
EOF
$PYTHON conftest.py
has_gconf=`cat conftest.out`
rm -f conftest.out conftest.py
if test NO = "$has_gconf"
then
AC_MSG_ERROR([
**** The python bindings for gconf (gnome2-python-gconf) could not be found.])
fi
AC_MSG_RESULT($has_gconf)
AC_MSG_CHECKING(Python bindings for gnome vfs)
cat > conftest.py <<EOF
$pygtk_require

View File

@ -20,11 +20,6 @@ xml_in_files = gramps.xml.in
xml_files = $(xml_in_files:.xml.in=.xml)
@INTLTOOL_XML_RULE@
schemasdir = $(GCONF_SCHEMA_FILE_DIR)
schemas_in_files = gramps.schemas.in
schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
@INTLTOOL_SCHEMAS_RULE@
applicationsdir = $(datadir)/application-registry
applications_DATA = gramps.applications
@ -56,37 +51,22 @@ EXTRA_DIST = \
$(applications_DATA) \
$(keys_in_files) \
$(desktop_in_files) \
$(schemas_in_files) \
$(mime_DATA) \
$(xml_DATA) \
$(desktop_DATA) \
$(schemas_DATA) \
$(xml_in_files)
CLEANFILES = \
$(desktop_DATA) \
$(keys_files) \
$(xml_files) \
$(schemas_DATA)
$(xml_files)
# Conditionally enable/disable gconf schemas or mime types,
# or disable both in a packager mode
GCONF_SCHEMAS_INSTALLATION =
GCONF_SCHEMAS_UNINSTALLATION =
SHARED_MIME_INSTALLATION =
SHARED_MIME_UNINSTALLATION =
if !PACKAGER_MODE
if GCONF_SCHEMAS_INSTALL
GCONF_SCHEMAS_INSTALLATION += \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
$(GCONFTOOL) --makefile-install-rule $(DESTDIR)$(GCONF_SCHEMA_FILE_DIR)/gramps.schemas ;\
pkill gconfd ; echo Restarting gconfd
GCONF_SCHEMAS_UNINSTALLATION += \
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \
$(GCONFTOOL) --makefile-uninstall-rule $(DESTDIR)$(GCONF_SCHEMA_FILE_DIR)/gramps.schemas
endif
if SHARED_MIME_INSTALL
SHARED_MIME_INSTALLATION += \
update-mime-database $(DESTDIR)$(SHARED_MIME_DIR)
@ -98,10 +78,6 @@ endif
install-data-hook:
$(SHARED_MIME_INSTALLATION)
$(GCONF_SCHEMAS_INSTALLATION)
uninstall-local:
$(GCONF_SCHEMAS_UNINSTALLATION)
uninstall-hook:
$(SHARED_MIME_UNINSTALLATION)

View File

@ -25,105 +25,105 @@
# python gen_schema_keys.py ../../data/gramps.schemas.in
# in the src/Config directory.
DEFAULT_SOURCE = ('preferences','default-source', 0)
RELATION_SHADE = ('preferences','relation-shade', 0)
ONLINE_MAPS = ('preferences','online-maps', 0)
FAMILY_DETAILS = ('preferences','family-details', 0)
COMPLETE_COLOR = ('preferences','complete-color', 2)
TODO_COLOR = ('preferences','todo-color', 2)
CUSTOM_MARKER_COLOR = ('preferences','custom-marker-color', 2)
FAMILY_WARN = ('preferences','family-warn', 0)
HIDE_EP_MSG = ('preferences','hide-ep-msg', 0)
LAST_VIEW = ('preferences','last-view', 1)
USE_LAST_VIEW = ('preferences','use-last-view', 0)
FAMILY_SIBLINGS = ('preferences','family-siblings', 0)
AUTOLOAD = ('behavior','autoload', 0)
ENABLE_AUTOBACKUP = ('behavior','enable-autobackup', 0)
SPELLCHECK = ('behavior','spellcheck', 0)
BETAWARN = ('behavior','betawarn', 0)
WELCOME = ('behavior','welcome', 1)
DATE_FORMAT = ('preferences','date-format', 1)
DONT_ASK = ('interface','dont-ask', 0)
RELEDITBTN = ('interface','releditbtn', 0)
HEIGHT = ('interface','height', 1)
WIDTH = ('interface','width', 1)
FAMILY_HEIGHT = ('interface','family-height', 1)
FAMILY_WIDTH = ('interface','family-width', 1)
NOTE_HEIGHT = ('interface','note-height', 1)
NOTE_WIDTH = ('interface','note-width', 1)
PERSON_HEIGHT = ('interface','person-height', 1)
PERSON_WIDTH = ('interface','person-width', 1)
EVENT_HEIGHT = ('interface','event-height', 1)
EVENT_WIDTH = ('interface','event-width', 1)
EVENT_REF_HEIGHT = ('interface','event-ref-height', 1)
EVENT_REF_WIDTH = ('interface','event-ref-width', 1)
PLACE_HEIGHT = ('interface','place-height', 1)
PLACE_WIDTH = ('interface','place-width', 1)
REPO_HEIGHT = ('interface','repo-height', 1)
REPO_WIDTH = ('interface','repo-width', 1)
MEDIA_HEIGHT = ('interface','media-height', 1)
MEDIA_WIDTH = ('interface','media-width', 1)
ADDRESS_HEIGHT = ('interface','address-height', 1)
ADDRESS_WIDTH = ('interface','address-width', 1)
ATTRIBUTE_HEIGHT = ('interface','attribute-height', 1)
ATTRIBUTE_WIDTH = ('interface','attribute-width', 1)
NAME_HEIGHT = ('interface','name-height', 1)
NAME_WIDTH = ('interface','name-width', 1)
SOURCE_HEIGHT = ('interface','source-height', 1)
SOURCE_WIDTH = ('interface','source-width', 1)
SOURCE_REF_HEIGHT = ('interface','source-ref-height', 1)
SOURCE_REF_WIDTH = ('interface','source-ref-width', 1)
FILTER = ('interface','filter', 0)
DATABASE_PATH = ('behavior','database-path', 2)
FPREFIX = ('preferences','fprefix', 2)
EPREFIX = ('preferences','eprefix', 2)
RPREFIX = ('preferences','rprefix', 2)
NPREFIX = ('preferences','nprefix', 2)
IPREFIX = ('preferences','iprefix', 2)
OPREFIX = ('preferences','oprefix', 2)
PPREFIX = ('preferences','pprefix', 2)
SPREFIX = ('preferences','sprefix', 2)
GOUTPUT_PREFERENCE = ('preferences','goutput-preference', 2)
OUTPUT_PREFERENCE = ('preferences','output-preference', 2)
PAPER_PREFERENCE = ('preferences','paper-preference', 2)
RECENT_FILE = ('paths','recent-file', 2)
RECENT_IMPORT_DIR = ('paths','recent-import-dir', 2)
RECENT_EXPORT_DIR = ('paths','recent-export-dir', 2)
NAME_FORMAT = ('preferences','name-format', 1)
REPORT_DIRECTORY = ('paths','report-directory', 2)
RESEARCHER_ADDR = ('researcher','researcher-addr', 2)
RESEARCHER_CITY = ('researcher','researcher-city', 2)
RESEARCHER_COUNTRY = ('researcher','researcher-country', 2)
RESEARCHER_EMAIL = ('researcher','researcher-email', 2)
RESEARCHER_NAME = ('researcher','researcher-name', 2)
RESEARCHER_PHONE = ('researcher','researcher-phone', 2)
RESEARCHER_POSTAL = ('researcher','researcher-postal', 2)
RESEARCHER_STATE = ('researcher','researcher-state', 2)
STARTUP = ('behavior','startup', 1)
SIZE_CHECKED = ('interface','size-checked', 0)
STATUSBAR = ('interface','statusbar', 1)
SURNAME_GUESSING = ('behavior','surname-guessing', 1)
TOOLBAR_ON = ('interface','toolbar-on', 0)
USE_TIPS = ('behavior','use-tips', 0)
POP_PLUGIN_STATUS = ('behavior','pop-plugin-status', 0)
VIEW = ('interface','view', 0)
SIDEBAR_TEXT = ('interface','sidebar-text', 0)
WEBSITE_DIRECTORY = ('paths','website-directory', 2)
PORT_WARN = ('preferences','port-warn', 0)
TRANSACTIONS = ('behavior','transactions', 0)
LDS_HEIGHT = ('interface','lds-height', 1)
LDS_WIDTH = ('interface','lds-width', 1)
LOCATION_HEIGHT = ('interface','location-height', 1)
LOCATION_WIDTH = ('interface','location-width', 1)
MEDIA_REF_HEIGHT = ('interface','media-ref-height', 1)
MEDIA_REF_WIDTH = ('interface','media-ref-width', 1)
URL_HEIGHT = ('interface','url-height', 1)
URL_WIDTH = ('interface','url-width', 1)
PERSON_REF_HEIGHT = ('interface','person-ref-height', 1)
PERSON_REF_WIDTH = ('interface','person-ref-width', 1)
REPO_REF_HEIGHT = ('interface','repo-ref-height', 1)
REPO_REF_WIDTH = ('interface','repo-ref-width', 1)
OWNER_WARN = ('behavior','owner-warn', 0)
DEFAULT_SOURCE = ('preferences', 'default-source', 0)
RELATION_SHADE = ('preferences', 'relation-shade', 0)
ONLINE_MAPS = ('preferences', 'online-maps', 0)
FAMILY_DETAILS = ('preferences', 'family-details', 0)
COMPLETE_COLOR = ('preferences', 'complete-color', 2)
TODO_COLOR = ('preferences', 'todo-color', 2)
CUSTOM_MARKER_COLOR = ('preferences', 'custom-marker-color', 2)
FAMILY_WARN = ('preferences', 'family-warn', 0)
HIDE_EP_MSG = ('preferences', 'hide-ep-msg', 0)
LAST_VIEW = ('preferences', 'last-view', 1)
USE_LAST_VIEW = ('preferences', 'use-last-view', 0)
FAMILY_SIBLINGS = ('preferences', 'family-siblings', 0)
AUTOLOAD = ('behavior', 'autoload', 0)
ENABLE_AUTOBACKUP = ('behavior', 'enable-autobackup', 0)
SPELLCHECK = ('behavior', 'spellcheck', 0)
BETAWARN = ('behavior', 'betawarn', 0)
WELCOME = ('behavior', 'welcome', 1)
DATE_FORMAT = ('preferences', 'date-format', 1)
DONT_ASK = ('interface', 'dont-ask', 0)
RELEDITBTN = ('interface', 'releditbtn', 0)
HEIGHT = ('interface', 'height', 1)
WIDTH = ('interface', 'width', 1)
FAMILY_HEIGHT = ('interface', 'family-height', 1)
FAMILY_WIDTH = ('interface', 'family-width', 1)
NOTE_HEIGHT = ('interface', 'note-height', 1)
NOTE_WIDTH = ('interface', 'note-width', 1)
PERSON_HEIGHT = ('interface', 'person-height', 1)
PERSON_WIDTH = ('interface', 'person-width', 1)
EVENT_HEIGHT = ('interface', 'event-height', 1)
EVENT_WIDTH = ('interface', 'event-width', 1)
EVENT_REF_HEIGHT = ('interface', 'event-ref-height', 1)
EVENT_REF_WIDTH = ('interface', 'event-ref-width', 1)
PLACE_HEIGHT = ('interface', 'place-height', 1)
PLACE_WIDTH = ('interface', 'place-width', 1)
REPO_HEIGHT = ('interface', 'repo-height', 1)
REPO_WIDTH = ('interface', 'repo-width', 1)
MEDIA_HEIGHT = ('interface', 'media-height', 1)
MEDIA_WIDTH = ('interface', 'media-width', 1)
ADDRESS_HEIGHT = ('interface', 'address-height', 1)
ADDRESS_WIDTH = ('interface', 'address-width', 1)
ATTRIBUTE_HEIGHT = ('interface', 'attribute-height', 1)
ATTRIBUTE_WIDTH = ('interface', 'attribute-width', 1)
NAME_HEIGHT = ('interface', 'name-height', 1)
NAME_WIDTH = ('interface', 'name-width', 1)
SOURCE_HEIGHT = ('interface', 'source-height', 1)
SOURCE_WIDTH = ('interface', 'source-width', 1)
SOURCE_REF_HEIGHT = ('interface', 'source-ref-height', 1)
SOURCE_REF_WIDTH = ('interface', 'source-ref-width', 1)
FILTER = ('interface', 'filter', 0)
DATABASE_PATH = ('behavior', 'database-path', 2)
FPREFIX = ('preferences', 'fprefix', 2)
EPREFIX = ('preferences', 'eprefix', 2)
RPREFIX = ('preferences', 'rprefix', 2)
NPREFIX = ('preferences', 'nprefix', 2)
IPREFIX = ('preferences', 'iprefix', 2)
OPREFIX = ('preferences', 'oprefix', 2)
PPREFIX = ('preferences', 'pprefix', 2)
SPREFIX = ('preferences', 'sprefix', 2)
GOUTPUT_PREFERENCE = ('preferences', 'goutput-preference', 2)
OUTPUT_PREFERENCE = ('preferences', 'output-preference', 2)
PAPER_PREFERENCE = ('preferences', 'paper-preference', 2)
RECENT_FILE = ('paths', 'recent-file', 2)
RECENT_IMPORT_DIR = ('paths', 'recent-import-dir', 2)
RECENT_EXPORT_DIR = ('paths', 'recent-export-dir', 2)
NAME_FORMAT = ('preferences', 'name-format', 1)
REPORT_DIRECTORY = ('paths', 'report-directory', 2)
RESEARCHER_ADDR = ('researcher', 'researcher-addr', 2)
RESEARCHER_CITY = ('researcher', 'researcher-city', 2)
RESEARCHER_COUNTRY = ('researcher', 'researcher-country', 2)
RESEARCHER_EMAIL = ('researcher', 'researcher-email', 2)
RESEARCHER_NAME = ('researcher', 'researcher-name', 2)
RESEARCHER_PHONE = ('researcher', 'researcher-phone', 2)
RESEARCHER_POSTAL = ('researcher', 'researcher-postal', 2)
RESEARCHER_STATE = ('researcher', 'researcher-state', 2)
STARTUP = ('behavior', 'startup', 1)
SIZE_CHECKED = ('interface', 'size-checked', 0)
STATUSBAR = ('interface', 'statusbar', 1)
SURNAME_GUESSING = ('behavior', 'surname-guessing', 1)
TOOLBAR_ON = ('interface', 'toolbar-on', 0)
USE_TIPS = ('behavior', 'use-tips', 0)
POP_PLUGIN_STATUS = ('behavior', 'pop-plugin-status', 0)
VIEW = ('interface', 'view', 0)
SIDEBAR_TEXT = ('interface', 'sidebar-text', 0)
WEBSITE_DIRECTORY = ('paths', 'website-directory', 2)
PORT_WARN = ('preferences', 'port-warn', 0)
TRANSACTIONS = ('behavior', 'transactions', 0)
LDS_HEIGHT = ('interface', 'lds-height', 1)
LDS_WIDTH = ('interface', 'lds-width', 1)
LOCATION_HEIGHT = ('interface', 'location-height', 1)
LOCATION_WIDTH = ('interface', 'location-width', 1)
MEDIA_REF_HEIGHT = ('interface', 'media-ref-height', 1)
MEDIA_REF_WIDTH = ('interface', 'media-ref-width', 1)
URL_HEIGHT = ('interface', 'url-height', 1)
URL_WIDTH = ('interface', 'url-width', 1)
PERSON_REF_HEIGHT = ('interface', 'person-ref-height', 1)
PERSON_REF_WIDTH = ('interface', 'person-ref-width', 1)
REPO_REF_HEIGHT = ('interface', 'repo-ref-height', 1)
REPO_REF_WIDTH = ('interface', 'repo-ref-width', 1)
OWNER_WARN = ('behavior', 'owner-warn', 0)
default_value = {

View File

@ -41,7 +41,7 @@ import Errors
from _GrampsConfigKeys import default_value
client = gconf.client_get_default()
client.add_dir("/apps/gramps",gconf.CLIENT_PRELOAD_NONE)
client.add_dir("/apps/gramps", gconf.CLIENT_PRELOAD_NONE)
#-------------------------------------------------------------------------
@ -57,16 +57,16 @@ def get_date_format(date_format_list):
return get_int("/apps/gramps/preferences/date-format",
range(len(date_format_list)))
def save_date_format(val,date_format_list):
set_int("/apps/gramps/preferences/date-format",val,
def save_date_format(val, date_format_list):
set_int("/apps/gramps/preferences/date-format", val,
range(len(date_format_list)))
def get_name_format(_name_format_list):
return get_int("/apps/gramps/preferences/name-format",
range(len(_name_format_list)))
def save_name_format(val,_name_format_list):
set_int("/apps/gramps/preferences/name-format",val,
def save_name_format(val, _name_format_list):
set_int("/apps/gramps/preferences/name-format", val,
range(len(_name_format_list)))
#-------------------------------------------------------------------------
@ -76,16 +76,16 @@ def save_name_format(val,_name_format_list):
#-------------------------------------------------------------------------
def set(key, value):
token = "/apps/gramps/%s/%s" % (key[0],key[1])
token = "/apps/gramps/%s/%s" % (key[0], key[1])
if key[2] == 0:
set_bool(token,value)
set_bool(token, value)
elif key[2] == 1:
set_int(token,value)
set_int(token, value)
else:
set_string(token,value)
set_string(token, value)
def get(key):
token = "/apps/gramps/%s/%s" % (key[0],key[1])
token = "/apps/gramps/%s/%s" % (key[0], key[1])
if key[2] == 0:
val = get_bool(token)
elif key[2] == 1:
@ -101,7 +101,7 @@ def get_bool(key):
val = client.get_bool(key)
except gobject.GError:
val = None
if val in (True,False):
if val in (True, False):
return val
else:
val = client.get_default_from_schema(key)
@ -109,11 +109,11 @@ def get_bool(key):
raise Errors.GConfSchemaError("No default value for key "+key)
return val.get_bool()
def set_bool(key,val):
if val in (True,False):
client.set_bool(key,val)
def set_bool(key, val):
if val in (True, False):
client.set_bool(key, val)
def get_int(key,correct_tuple=None):
def get_int(key, correct_tuple=None):
try:
val = client.get_int(key)
except gobject.GError:
@ -126,11 +126,11 @@ def get_int(key,correct_tuple=None):
raise Errors.GConfSchemaError("No default value for key "+key)
return val.get_int()
def set_int(key,val,correct_tuple=None):
def set_int(key, val, correct_tuple=None):
if not correct_tuple or val in correct_tuple:
client.set_int(key,val)
client.set_int(key, val)
def get_string(key,test_func=None):
def get_string(key, test_func=None):
try:
val = client.get_string(key)
except gobject.GError:
@ -143,19 +143,19 @@ def get_string(key,test_func=None):
raise Errors.GConfSchemaError("No default value for key "+key)
return val.get_string()
def set_string(key,val,test_func=None):
def set_string(key, val, test_func=None):
if not test_func or test_func(val):
client.set_string(key,val)
client.set_string(key, val)
def sync():
client.suggest_sync()
def get_default(key,sample=''):
token = "/apps/gramps/%s/%s" % (key[0],key[1])
def get_default(key, sample=''):
token = "/apps/gramps/%s/%s" % (key[0], key[1])
value = client.get_default_from_schema(token)
if value == None:
raise Errors.GConfSchemaError("No default value for key "+key[1])
if type(sample) in (str,unicode):
if type(sample) in (str, unicode):
return value.get_string()
elif type(sample) == int:
return value.get_int()

View File

@ -33,6 +33,8 @@ from _GrampsConfigKeys import *
NL = "\n" # FIX: newlines on Mac/Windows, if different?
INIFILE = os.path.join(const.home_dir,"keys.ini")
def make_bool(val):
""" Function to turn strings into booleans. """
# these are the possible strings that should be considered False
@ -158,7 +160,7 @@ class IniKeyClient:
def suggest_sync(self):
self.save_ini() # save back to default file, if named
client = IniKeyClient(os.path.join(const.home_dir,"keys.ini"))
client = IniKeyClient(INIFILE)
#-------------------------------------------------------------------------
#

View File

@ -25,14 +25,24 @@ This package implements access to GRAMPS configuration.
It provides the choice between different storage backends.
"""
import const
from _GrampsConfigKeys import *
from _GrampsIniKeys import *
if const.no_gconf:
from _GrampsIniKeys import *
else:
import os
def __upgrade_gconf():
import _GrampsGconfKeys as GconfKeys
print "Upgrading INI file"
for key in default_value.keys():
data = GconfKeys.get(key)
set(key, data)
if not os.path.exists(INIFILE):
try:
from _GrampsGconfKeys import *
except:
from _GrampsIniKeys import *
__upgrade_gconf()
except ImportError:
print "Cannot upgrade GCONF settings"

View File

@ -41,7 +41,7 @@ import locale
#
#-------------------------------------------------------------------------
import logging
log = logging.getLogger(".Spell")
LOG = logging.getLogger(".Spell")
#-------------------------------------------------------------------------
#
@ -53,7 +53,7 @@ try:
import gtkspell
HAVE_GTKSPELL = True
except ImportError:
log.warn(_("Spelling checker is not installed"))
LOG.warn(_("Spelling checker is not installed"))
HAVE_GTKSPELL = False
#-------------------------------------------------------------------------
@ -162,7 +162,7 @@ LANGUAGES = {
class Spell:
"""Attach a gtkspell instance to the passed TextView instance.
"""
_LANG = locale.getlocale()[0]
lang = locale.getlocale()[0]
_installed_languages = {'off': _('None')}
@ -177,19 +177,19 @@ class Spell:
def __init__(self, textview):
self.textview = textview
if self._LANG and Config.get(Config.SPELLCHECK):
if self.lang and Config.get(Config.SPELLCHECK):
# if LANG is not a correct key (pt_BR or pt_PT),
# try only the language part of LANG
if self._LANG not in self._installed_languages.keys():
self._LANG = self._LANG.split('_')[0]
if self.lang not in self._installed_languages.keys():
self.lang = self.lang.split('_')[0]
# if this still doesn't work we fall back to 'off'
if self._LANG not in self._installed_languages.keys():
self._LANG = 'off'
if self.lang not in self._installed_languages.keys():
self.lang = 'off'
else:
self._LANG = 'off'
self.lang = 'off'
self._active_language = 'off'
self._real_set_active_language(self._LANG)
self._real_set_active_language(self.lang)
def _real_set_active_language(self, lang_code):
"""Set the active language by it's code."""
@ -208,26 +208,10 @@ class Spell:
gtkspell_spell.set_language(lang_code)
self._active_language = lang_code
def _sort_languages(self, lang_a, lang_b):
"""Put language names in alphabetical order.
Except 'None', which should be always the first.
"""
if lang_a == _('None'):
return -1
if lang_b == _('None'):
return 1
if lang_a < lang_b:
return -1
if lang_a > lang_b:
return 1
return 0
def get_all_languages(self):
"""Get the list of installed language names."""
langs = self._installed_languages.values()
langs.sort(self._sort_languages)
langs.sort(sort_languages)
return langs
def set_active_language(self, language):
@ -240,3 +224,20 @@ class Spell:
def get_active_language(self):
"""Get the name of the active language."""
return self._installed_languages[self._active_language]
def sort_languages(lang_a, lang_b):
"""Put language names in alphabetical order.
Except 'None', which should be always the first.
"""
if lang_a == _('None'):
return -1
if lang_b == _('None'):
return 1
if lang_a < lang_b:
return -1
if lang_a > lang_b:
return 1
return 0

View File

@ -159,9 +159,9 @@ register_tool(
tool_class = EventNames,
options_class = EventNamesOptions,
modes = Tool.MODE_GUI,
translated_name = _("Extract event names from data"),
translated_name = _("Extract event descriptions from event data"),
status = _("Stable"),
author_name = "Donald N. Allingham",
author_email = "don@gramps-project.org",
description = _("Extracts event names from the event data")
description = _("Extracts event descriptions from the event data")
)

View File

@ -377,10 +377,10 @@ register_tool(
tool_class = ExtractCity,
options_class = ExtractCityOptions,
modes = Tool.MODE_GUI,
translated_name = _("Extract city and state information from a place"),
translated_name = _("Extract place data from a place title"),
status = _("Stable"),
author_name = "Donald N. Allingham",
author_email = "don@gramps-project.org",
description = _("Attempts to extract city and state/province "
"from a place name")
"from a place title")
)