library-web r545 - in trunk: . src
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: library-web r545 - in trunk: . src
- Date: Thu, 27 Nov 2008 22:06:21 +0000 (UTC)
Author: fpeters
Date: Thu Nov 27 22:06:20 2008
New Revision: 545
URL: http://svn.gnome.org/viewvc/library-web?rev=545&view=rev
Log:
* src/lgo.py: also check for title nodes within xhtml namespace as
some g-d-u versions can produce them; this helps detecting properly
depreciated documents. (closes: #562008)
Modified:
trunk/ChangeLog
trunk/src/lgo.py
Modified: trunk/src/lgo.py
==============================================================================
--- trunk/src/lgo.py (original)
+++ trunk/src/lgo.py Thu Nov 27 22:06:20 2008
@@ -1041,8 +1041,13 @@
def process_xml_index(self, xml_index_file, doc, lang):
tree = ET.parse(xml_index_file)
- if tree.find('title') is not None and \
- tree.find('title').text == 'Problem showing document':
+ title_node_text = None
+ if tree.find('title') is not None:
+ title_node_text = tree.find('title').text
+ elif tree.find('{http://www.w3.org/1999/xhtml}title') is not None:
+ title_node_text = tree.find('{http://www.w3.org/1999/xhtml}title').text
+
+ if title_node_text == 'Problem showing document':
# title used in gnome-panel for depreciated documentation (such
# as window-list applet, moved to user guide); abort now, and
# remove this version. Note it would be much easier if this
@@ -1068,12 +1073,8 @@
quirks = app.overlay.get_quirks(self)
- if not self.nightly or not doc.title.get(lang):
- if tree.find('title') is not None and tree.find('title').text:
- doc.title[lang] = tree.find('title').text
- elif tree.find('{http://www.w3.org/1999/xhtml}title') is not None and \
- tree.find('{http://www.w3.org/1999/xhtml}title').text:
- doc.title[lang] = tree.find('{http://www.w3.org/1999/xhtml}title').text
+ if not self.nightly or not doc.title.get(lang) and title_node_text:
+ doc.title[lang] = title_node_text
if tree.find('abstract') is not None and tree.find('abstract').text:
doc.abstract[lang] = tree.find('abstract').text
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]