[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[gopher] Re: .names



On Tue, Dec 16, 2003 at 07:50:39PM -0600, Chris wrote:
> under pygopherd it doesnt. 
OK, I think this is fixed.  I have just uploaded PyGopherd 2.0.7.  Or,
you can apply the attached patch to your 2.0.6 installation.

Let me know if it works for you.

-- John


-- Attached file included as plaintext by Ecartis --

Index: pygopherd/handlers/UMN.py
===================================================================
--- pygopherd/handlers/UMN.py	(revision 299)
+++ pygopherd/handlers/UMN.py	(working copy)
@@ -151,6 +151,19 @@
         for field in new.geteadict().keys():
             old.setea(field, new.getea(field))
 
+    def sortLinkEntries(self, x, y):
+        """Called by processLinkFile() to sort entries according to the
+        specified number."""
+        xnum = x.getnum()
+        ynum = y.getnum()
+        if xnum == ynum:
+            return 0
+        if xnum == None:
+            return -1
+        if ynum == None:
+            return 1
+        return cmp(xnum, ynum)
+
     def processLinkFile(self, filename, capfilepath = None):
         """Processes a link file.  If capfilepath is set, it should
         be the equivolent of the Path= in a .names file."""
@@ -162,6 +175,7 @@
                 linkentries.append(entry)
             if nextstep == 'stop':
                 break
+        linkentries.sort(self.sortLinkEntries)
         return linkentries
         
     def getLinkItem(self, fd, capfilepath = None):




Reply to: