Complete.Org: Mailing Lists: Archives: gopher: December 2003:
[gopher] Re: .names

[gopher] Re: .names

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: gopher@xxxxxxxxxxxx
Subject: [gopher] Re: .names
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Wed, 17 Dec 2003 09:29:17 -0600
Reply-to: gopher@xxxxxxxxxxxx

On Wed, Dec 17, 2003 at 08:33:26AM -0600, John Goerzen wrote:
> 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.
OK, I'm a little red-faced now.  Here's the full scoop.

I *had* ported the UMN Numb-handling code to Python, and it was in place
already.  So the first patch I sent you was unnecessary.

What I failed to so was mimic the UMN behavior for situations where the
Numb was not specified.  This broke the whole thing.  So the real fix is
in 2.0.8, and attached.  It works for me.

-- John

-- Attached file included as plaintext by Ecartis --

Index: pygopherd/handlers/
--- pygopherd/handlers/   (revision 297)
+++ pygopherd/handlers/   (working copy)
@@ -266,17 +266,19 @@
             return 1
         if == None:
             return -1
+        e1num = entry1.getnum(0)
+        e2num = entry2.getnum(0)
         # Equal numbers or no numbers: sort by title.
-        if entry1.num == entry2.num:
+        if e1num == e2num:
             return cmp(,
         # Same signs: use plain numeric comparison.
-        if (self.sgn(entry1.num) == self.sgn(entry2.num)):
-            return cmp(entry1.num, entry2.num)
+        if (self.sgn(e1num) == self.sgn(e2num)):
+            return cmp(e1num, e2num)
         # Different signs: other comparison.
-        if entry1.num > entry2.num:
+        if e1num > e2num:
             return -1
             return 1

[Prev in Thread] Current Thread [Next in Thread]