[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - cvsloader.py:1.22

Fred L. Drake, Jr. fred at zope.com
Thu May 6 22:39:56 EDT 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv11235

Modified Files:
	cvsloader.py 
Log Message:
- docstrings for UrlBase
- UrlBase.__str__() should be __repr__()


=== Packages/zpkgtools/zpkgtools/cvsloader.py 1.21 => 1.22 ===
--- Packages/zpkgtools/zpkgtools/cvsloader.py:1.21	Fri Apr 30 13:35:48 2004
+++ Packages/zpkgtools/zpkgtools/cvsloader.py	Thu May  6 22:39:55 2004
@@ -131,11 +131,25 @@
 
 
 class UrlBase:
+    """Base class for parsed-URL objects."""
 
-    def __str__(self):
+    def __repr__(self):
+        """Indicate the URL represented by the instance.
+
+        This requires the derived class to implement `getUrl()`.
+
+        :rtype: str
+        """
         return "<%s.%s: %s>" % (self.__class__.__module__,
                                 self.__class__.__name__,
                                 self.getUrl())
+
+    def getUrl(self):
+        """Return the URL represented by the instance as a simple string.
+
+        :rtype: str
+        """
+        raise NotImplementedError
 
 
 class CvsUrl(UrlBase):




More information about the Zope-CVS mailing list