Check whether pil or convert exist

svn: r1548
This commit is contained in:
Alex Roitman 2003-05-20 17:55:52 +00:00
parent a7a9622f39
commit 38744beba8
3 changed files with 49 additions and 31 deletions

View File

@ -4,45 +4,37 @@ If building from source, also read the INSTALL file (at least through the
Requirements
--------------------------------
Python 1.5.2 or greater
Gnome 1.2 or greater
PyGnome 1.0.53 or greater
The following packages *MUST* be installed in order for Gramps to work:
Python 2.2 or greater
Gnome 2.0 or greater
PyGTK2 1.99.14 or greater
PyXML 0.7.1 or greater
If you are using python 1.5.2, you may also need PyXML 0.6.2 or
greater. Many distributions already provide this, but if your
Many distributions already provide PyXML, but if your
installation does not have it, you can get it from
http://sourceforge.net/project/showfiles.php?group_id=6473
The following packages are *STRONGLY RECOMMENDED* to be installed:
Reportlab Enable creation of PDF documents
http://www.reportlab.com
Python Imaging Library (PIL)
Enable generation of thumbnails for images
http://www.pythonware.com/products/pil
Documentation
---------------------------------
Gramps documentation is supplied in the form of SGML files, which will be
installed in the GNOME help path(*). Recent versions of Nautilus and Galeon
can generate HTML on-the-fly documents from these. For more information on
building HTML files (including info about packages that do and do not work
with the documentation) see the INSTALL file. To generate HTML
documentation the following packages *MUST* installed:
* db2html >= 0.6.9 (jw >= 1.1) to convert the SGML -> HTML
* gnome-doc-tools-2-1 for the GNOME documentation style sheets
The former is part of the docbook-utils package, the latter can be found
from the developer section at gnome.org. (note that docbook-utils 0.6.10 is
buggy)
One also needs png support for sgml, which should be a part of the
gnome-doc-tools package. The /etc/sgml/catalog file should
contain an entry pointing to PNG support. If configured properly, your
db2html should automatically look up and use the /etc/sgml/catalog file.
Gramps documentation is supplied in the form of XML files, which will be
installed in the GNOME help path(*). Gnome help browser (Yelp) uses these
(properly installed) XML files to display the documentation.
Of course, current HTML documentation can also be found on the gramps website,
http://gramps.sourceforge.net/help.html
(*) More precisely, they are installed in ${prefix}/share/gnome/help, where
${prefix} is given by the --prefix= option to configure. If this is
different from where your standard GNOME installation looks for help files
and documentation, then set your GNOMEDIR environment variable to the
${prefix} path before starting gramps. For example, if you are installing
gramps in /usr/local/, then type the following:
in tcsh: setenv GNOMEDIR /usr/local/
in bash: GNOMEDIR=/usr/local/ ; export GNOMEDIR
(*) More precisely, they are installed
in ${prefix}/share/gramps/gnome/help/gramps,
where ${prefix} is given by the --prefix= option
to configure (defaults to /usr).
Building on non-Linux systems: i18n support and GNU make

View File

@ -47,7 +47,7 @@ import const
import ImageSelect
import RelImage
from QuestionDialog import QuestionDialog, ErrorDialog
from QuestionDialog import QuestionDialog, ErrorDialog, WarningDialog
#-------------------------------------------------------------------------
#
@ -119,6 +119,12 @@ class MediaView:
self.update = update
self.list.connect('button-press-event',self.on_button_press_event)
self.selection.connect('changed',self.on_select_row)
if not (RelImage.is_pil() or RelImage.is_cnv() ):
WarningDialog(_("Thumbnails not available")
,_("There is no suitable tool to generate thumbnails for the images. "
"If you would like to enable this feature, "
"install Python Imaging Library (PIL), available at http://www.pythonware.com/products/pil/ "
"or ImageMagick, available http://www.imagemagick.org/"))
def goto(self,id):
self.selection.unselect_all()

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
# Copyright (C) 2000-2003 Donald N. Allingham
#
# 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
@ -178,3 +178,23 @@ def check_thumb(source,dest,size):
return 1
#-------------------------------------------------------------------------
#
# Test if there's PIL available
#
#-------------------------------------------------------------------------
def is_pil():
try:
from PIL import __name__ as pilname
return 1
except:
return 0
#-------------------------------------------------------------------------
#
# Test if there's convert available
#
#-------------------------------------------------------------------------
def is_cnv():
return not os.system('which convert>/dev/null')