Gentoo Archives: gentoo-commits

From: "André Erdmann" <dywi@×××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/metadata/
Date: Tue, 26 Jun 2012 15:43:40
Message-Id: 1340725126.b0739582a711f64395226e8c33a4a3a6b9b66298.dywi@gentoo
commit:     b0739582a711f64395226e8c33a4a3a6b9b66298
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Jun 26 15:38:46 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Jun 26 15:38:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=b0739582

fix metadata creation

* replaces yesterday's workaround

	modified:   roverlay/metadata/__init__.py
	modified:   roverlay/metadata/nodes.py

---
 roverlay/metadata/__init__.py |   37 ++++++++++++++++++++-----------------
 roverlay/metadata/nodes.py    |   10 ++++------
 2 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/roverlay/metadata/__init__.py b/roverlay/metadata/__init__.py
index 3385119..13fc169 100644
--- a/roverlay/metadata/__init__.py
+++ b/roverlay/metadata/__init__.py
@@ -6,6 +6,8 @@ import roverlay.config
 
 from roverlay.metadata import nodes
 
+USE_FULL_DESCRIPTION = True
+
 class MetadataJob ( object ):
 	"""R package description data -> metadata.xml interface."""
 
@@ -34,28 +36,29 @@ class MetadataJob ( object ):
 
 		returns: None (implicit)
 		"""
-		desc_data = package_info ['desc_data']
+		data = package_info ['desc_data']
 
 		mref = self._metadata
 
 		max_textline_width = roverlay.config.get ( 'METADATA.linewidth', 65 )
 
-		# FIXME/TODO remove long/not long bool from DescriptionNode!
-
-		if 'Description' in desc_data:
-			# !passing have_desc for DescriptionNode's is_long parameter redirects
-			# !the second description info into <longdescription.../>
-			mref.add ( nodes.DescriptionNode (
-				desc_data ['Description'],
-				is_long=True,
-				linewidth=max_textline_width
-			) )
-		elif 'Title' in desc_data:
-			mref.add ( nodes.DescriptionNode (
-				desc_data ['Title'],
-				is_long=True,
-				linewidth=max_textline_width
-			) )
+
+		description = None
+
+		if USE_FULL_DESCRIPTION and 'Title' in data and 'Description' in data:
+			description = data ['Title'] + ' // ' + data ['Description']
+
+		elif 'Description' in data:
+			description = ddata ['Description']
+
+		elif 'Title' in data:
+			description = data ['Title']
+
+		#if description:
+		if description is not None:
+			mref.add (
+				nodes.DescriptionNode ( description, linewidth=max_textline_width )
+			)
 
 		# these USE flags are described in profiles/use.desc,
 		#  no need to include them here

diff --git a/roverlay/metadata/nodes.py b/roverlay/metadata/nodes.py
index 4d4d5fd..1fba079 100644
--- a/roverlay/metadata/nodes.py
+++ b/roverlay/metadata/nodes.py
@@ -100,25 +100,23 @@ class MetadataRoot ( MetadataNodeNamedAccess ):
 
 
 class DescriptionNode ( MetadataLeaf ):
-	"""A description (<description.../>, <longdescription.../>) node."""
+	"""A description (<longdescription.../>) node."""
 
-	def __init__ ( self, description, is_long=False, linewidth=None ):
+	def __init__ ( self, description, linewidth=None ):
 		"""Initializes a DescriptionNode.
 
 		arguments:
 		* description -- description text
-		* is_long     -- if this is a longdescription or a description node
 		* linewidth   -- max text line width
 		"""
 		super ( DescriptionNode, self ) . __init__ (
-			'longdescription' if is_long else 'description',
-			value=description,
+			'longdescription', value=description
 		)
 
 		if not linewidth is None and linewidth > 0:
 			self.linewidth = linewidth
 
-		self.priority = 150 if is_long else 149
+		self.priority = 150
 	# --- end of __init__ (...) ---
 
 	# using value formatting