[gopher] Re: .names
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.
-- Attached file included as plaintext by Ecartis --
--- pygopherd/handlers/UMN.py (revision 297)
+++ pygopherd/handlers/UMN.py (working copy)
@@ -266,17 +266,19 @@
if entry2.name == None:
+ 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(entry1.name, entry2.name)
# 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: