* NEWS: Update.

* src/docgen/HtmlDoc.py (build_style_declaration): Use top- and
bottom- margins for paragraph styles.

* src/Utils.py (find_file): new method that tries to check the
  existance of a file by trying out multiple encoding variants for
  the filename.
  (cleanup_missing_photos) Use Utils.find_file to fix encoding problems
* src/gramps_main.py: Use Utils.find_file and Utils.find_folder to
  enable using unicode names for gramps databases


svn: r5435
This commit is contained in:
Alex Roitman 2005-11-25 03:09:10 +00:00
parent 14e674d5af
commit f141edf70d
3 changed files with 55 additions and 25 deletions

View File

@ -1,3 +1,8 @@
2005-11-24 Alex Roitman <shura@gramps-project.org>
* NEWS: Update.
* src/docgen/HtmlDoc.py (build_style_declaration): Use top- and
bottom- margins for paragraph styles.
2005-11-23 Don Allingham <don@gramps-project.org> 2005-11-23 Don Allingham <don@gramps-project.org>
* src/docgen/KwordDoc.py: fix margins and fonts. * src/docgen/KwordDoc.py: fix margins and fonts.
@ -82,18 +87,18 @@
* src/DateParser.py: match end of string for regex matching * src/DateParser.py: match end of string for regex matching
2005-11-18 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-11-18 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/Utils.py (find_file): new method that tries to check the existance * src/Utils.py (find_file): new method that tries to check the
of a file by trying out multiple encoding variants for the filename. existance of a file by trying out multiple encoding variants for
the filename.
* src/ImgManip.py (get_thumbnail_image): Use Utils.find_file to fix * src/ImgManip.py (get_thumbnail_image): Use Utils.find_file to fix
encoding problems, additionally catch OSError encoding problems, additionally catch OSError
* src/ImageSelect.py (on_name_changed): Use Utils.find_file * src/ImageSelect.py (on_name_changed): Use Utils.find_file
* src/AddMedia.py (on_name_changed): Use Utils.find_file * src/AddMedia.py (on_name_changed): Use Utils.find_file
* src/plugins/Check.py (encoding) dont encode a utf-8 string as again, * src/plugins/Check.py (encoding) dont encode a utf-8 string as again,
(cleanup_missing_photos) Use Utils.find_file to fix encoding problems (cleanup_missing_photos) Use Utils.find_file to fix encoding problems
* src/Utils.py (find_folder): new method * src/Utils.py (find_folder): new method
* src/gramps_main.py: Use Utils.find_file and Utils.find_folder to enable * src/gramps_main.py: Use Utils.find_file and Utils.find_folder to
using unicode names for gramps databases enable using unicode names for gramps databases
2005-11-17 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-11-17 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/gramps.glade, * src/gramps.glade,

View File

@ -1,4 +1,11 @@
Version 2.0.9 -- the "Nobody expects the Spanish inquisition!" release Version 2.0.9 -- the "Nobody expects the Spanish inquisition!" release
* Incremental interface improvements.
* Automated testing added, based on the CLI functionality.
* Smaller number of supported reports.
* Report rendering improvements in OOo, PDF, gnome-print, PS, HTML,
abw, and kwd formats.
* New filter rule: Ancestor of bookmarked person less than N generations
away (Wayne Bergeron).
* Numerous web generator improvements. * Numerous web generator improvements.
* GEDCOM import supports forward-referencing named notes. * GEDCOM import supports forward-referencing named notes.
* User manual updates. * User manual updates.
@ -7,7 +14,7 @@ Version 2.0.9 -- the "Nobody expects the Spanish inquisition!" release
* Persistent options for tools, as applicable. * Persistent options for tools, as applicable.
* Export patronymic names into GEDCOM. * Export patronymic names into GEDCOM.
* Updates for Swedish translation and date localization (Stefan Bjork). * Updates for Swedish translation and date localization (Stefan Bjork).
* Fully formalized XML format (DTD and RELAX NG schema). * Fully formalized XML format (DTD and RelaxNG schema).
* New plugin documenting command line reference. * New plugin documenting command line reference.
* Memory leak in libbglade worked around. * Memory leak in libbglade worked around.
* Limitation of 31 generations in reports removed. * Limitation of 31 generations in reports removed.

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2000-2004 Donald N. Allingham # Copyright (C) 2000-2005 Donald N. Allingham
# #
# 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
@ -20,11 +20,21 @@
# $Id$ # $Id$
#------------------------------------------------------------------------
#
# python modules
#
#------------------------------------------------------------------------
import os import os
import string
import re import re
import time import time
from gettext import gettext as _
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
import PluginMgr import PluginMgr
import ImgManip import ImgManip
import TarFile import TarFile
@ -34,12 +44,17 @@ import BaseDoc
import QuestionDialog import QuestionDialog
import GrampsMime import GrampsMime
from gettext import gettext as _ #------------------------------------------------------------------------
#
t_header_line_re = re.compile(r"(.*)<TITLE>(.*)</TITLE>(.*)", # Constant regular expressions
re.DOTALL|re.IGNORECASE|re.MULTILINE) #
t_keyword_line_re = re.compile(r'(.*name="keywords"\s+content=")([^\"]*)(".*)$', #------------------------------------------------------------------------
re.DOTALL|re.IGNORECASE|re.MULTILINE) t_header_line_re = re.compile(
r"(.*)<TITLE>(.*)</TITLE>(.*)",
re.DOTALL|re.IGNORECASE|re.MULTILINE)
t_keyword_line_re = re.compile(
r'(.*name="keywords"\s+content=")([^\"]*)(".*)$',
re.DOTALL|re.IGNORECASE|re.MULTILINE)
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
@ -126,7 +141,7 @@ class HtmlDoc(BaseDoc.BaseDoc):
self.image_dir = dirname self.image_dir = dirname
def set_keywords(self,keywords): def set_keywords(self,keywords):
self.meta = string.join(keywords,",") self.meta = ",".join(keywords)
def load_tpkg(self): def load_tpkg(self):
start = re.compile(r"<!--\s*START\s*-->") start = re.compile(r"<!--\s*START\s*-->")
@ -207,8 +222,8 @@ class HtmlDoc(BaseDoc.BaseDoc):
self.top = _top self.top = _top
def process_line(self,line): def process_line(self,line):
l = string.replace(line,'$VERSION',const.version) l = line.replace('$VERSION',const.version)
return string.replace(l,'$COPYRIGHT',self.copyright) return l.replace('$COPYRIGHT',self.copyright)
def open(self,filename): def open(self,filename):
(r,e) = os.path.splitext(filename) (r,e) = os.path.splitext(filename)
@ -242,7 +257,7 @@ class HtmlDoc(BaseDoc.BaseDoc):
self.f.write(self.style_declaration) self.f.write(self.style_declaration)
def build_header(self): def build_header(self):
self.fix_title(string.join(self.top, "")) self.fix_title("".join(self.top))
def fix_title(self,msg=None): def fix_title(self,msg=None):
if msg == None: if msg == None:
@ -290,6 +305,8 @@ class HtmlDoc(BaseDoc.BaseDoc):
text_indent = "%.2f" % style.get_first_indent() text_indent = "%.2f" % style.get_first_indent()
right_margin = "%.2f" % style.get_right_margin() right_margin = "%.2f" % style.get_right_margin()
left_margin = "%.2f" % style.get_left_margin() left_margin = "%.2f" % style.get_left_margin()
top_margin = "%.2f" % style.get_top_margin()
bottom_margin = "%.2f" % style.get_bottom_margin()
top = bottom = left = right = 'none' top = bottom = left = right = 'none'
if style.get_top_border(): if style.get_top_border():
@ -315,17 +332,19 @@ class HtmlDoc(BaseDoc.BaseDoc):
'\tfont-size: %dpt; color: %s;\n' '\tfont-size: %dpt; color: %s;\n'
'\ttext-align: %s; text-indent: %scm;\n' '\ttext-align: %s; text-indent: %scm;\n'
'\tmargin-right: %scm; margin-left: %scm;\n' '\tmargin-right: %scm; margin-left: %scm;\n'
'\tmargin-top: %scm; margin-bottom: %scm;\n'
'\tborder-top:%s; border-bottom:%s;\n' '\tborder-top:%s; border-bottom:%s;\n'
'\tborder-left:%s; border-right:%s;\n' '\tborder-left:%s; border-right:%s;\n'
'\t%s%sfont-family:%s;\n}' '\t%s%sfont-family:%s;\n}'
% (key, font_size, font_color, % (key, font_size, font_color,
align, text_indent, align, text_indent,
right_margin, left_margin, right_margin, left_margin,
top_margin, bottom_margin,
top, bottom, left, right, top, bottom, left, right,
italic, bold, family)) italic, bold, family))
text.append('-->\n</style>') text.append('-->\n</style>')
self.style_declaration = string.join(text,'\n') self.style_declaration = '\n'.join(text)
def close(self): def close(self):
for line in self.bottom: for line in self.bottom:
@ -460,10 +479,10 @@ class HtmlDoc(BaseDoc.BaseDoc):
self.end_paragraph() self.end_paragraph()
def write_text(self,text): def write_text(self,text):
text = string.replace(text,'&','&amp;'); # Must be first text = text.replace('&','&amp;'); # Must be first
text = string.replace(text,'<','&lt;'); text = text.replace('<','&lt;');
text = string.replace(text,'>','&gt;'); text = text.replace('>','&gt;');
text = string.replace(text,'\n','<br>') text = text.replace('\n','<br>')
text = text.replace('&lt;super&gt;','<sup>') text = text.replace('&lt;super&gt;','<sup>')
text = text.replace('&lt;/super&gt;','</sup>') text = text.replace('&lt;/super&gt;','</sup>')
if text != "": if text != "":
@ -475,7 +494,6 @@ class HtmlDoc(BaseDoc.BaseDoc):
# Register the document generator with the GRAMPS plugin system # Register the document generator with the GRAMPS plugin system
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
try: try:
import Utils import Utils