[PXCDD-commit] SF.net SVN: pxcdd: [368] trunk/server/rss/PyRSS2Gen.py
Status: Alpha
Brought to you by:
tangentsoft
From: <ric...@us...> - 2006-07-07 04:04:57
|
Revision: 368 Author: ricknroll Date: 2006-07-06 21:04:53 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/pxcdd/?rev=368&view=rev Log Message: ----------- python 2.2 compatibiity: workaround for basestring Modified Paths: -------------- trunk/server/rss/PyRSS2Gen.py Modified: trunk/server/rss/PyRSS2Gen.py =================================================================== --- trunk/server/rss/PyRSS2Gen.py 2006-07-07 04:03:08 UTC (rev 367) +++ trunk/server/rss/PyRSS2Gen.py 2006-07-07 04:04:53 UTC (rev 368) @@ -28,9 +28,9 @@ def _element(handler, name, obj, d = {}): - if isinstance(obj, basestring) or obj is None: + if isinstance(obj, (str, unicode)) or obj is None: # special-case handling to make the API easier - # to use for the common case. + # to use for the common case. handler.startElement(name, d) if obj is not None: handler.characters(obj) @@ -95,7 +95,8 @@ def __init__(self, name, dt): self.name = name self.dt = dt - def publish(self, handler): + def publish(self, handler): + print("[[[",_format_date(self.dt)); _element(handler, self.name, _format_date(self.dt)) #### @@ -204,7 +205,7 @@ self.url = url self.length = length self.type = type - def publish(self, handler): + def publish(self, handler): _element(handler, "enclosure", None, {"url": self.url, "length": str(self.length), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |