[gpodder-devel] gPodder 0.9.0 preparations: Please translate and test!

  • From: nikosapi at gmail.com (nikosapi)
  • Date: Wed, 17 Jan 2007 15:40:10 -0500

Ok, I dug into this and found the problem. It seems FC6 uses they're own 
version of wget (as you suspected). I don't know why they do this, the 
official GNU one is more informative in a terminal. 
I looked through libwget and reenacted it on the command line and these are my 
results (this is right before the regexp is tested against msg): 

Stock FC6 wget:
'500K .......... .......... .......... .......... ..........  1%  518K 84s'
Official GNU wget:
'700K .......... .......... .......... .......... ..........  2%  505.27 KB/s'

As you can see the your regexp won't pickup something like 518K, so either a 
better (more complicated) regexp has to be created or something like this 
could do it:

Replace this:
iter = re.compile('...K .*s').finditer( msg)
for speed_string in iter:
        self.speed = speed_string.group(0).strip()

With something like this:
speed_msg = msg.split()[7]
if re.search('[KB]', speed_msg):
        self.speed = speed_msg
else:
        iter = re.compile('...\... .B\/s').finditer( msg)
        for speed_string in iter:
                self.speed = speed_string.group(0).strip()

I've attached a patch for people using Red Hat based distros to try.

nick

P.S. If anyone wants the FC6 wget binary to tinker around with I can post it 
up.


On Wednesday 17 January 2007 13:17, Thomas Perl wrote:
> Hello nikosapi,
>
> On Tue, 16 Jan 2007 20:17:22 -0500 nikosapi wrote:
> > 1) Add a timeout to the wget command, like -T 10 in case a feed is
> > down then the max you have to wait is 30 sec (see the wget man page).
>
> That's a good idea, thanks -> I've added a 15 seconds timeout just to
> make sure it won't timeout too much when not needed (I'm still on 64k
> at home :). Fixed in current svn trunk head.
>
> > 2) For some odd reason on my FC6 box I still can't see the download
> > speed, I just get "unknown". I looked at libwget but I can't see a
> > problem. Here's a sample wget output from my FC6 box:
> > 21% [====>                      ] 5,067,240   95.5K/s  eta 1m 51s
> > And here's one from my Ubuntu box:
> > 34% [=======>                ] 8,019,516    277.87K/s    ETA 01:19
>
> Strange. This shouldn't happen of course. What does "wget --version"
> output on each of your boxes? gPodder "reads" the current download
> speed by trying to match the download speed with a regular expression,
> but it should not be fooled by the difference of the "ETA" part. Maybe
> you can investigate further or try out a locally-compiled wget just to
> make sure it's not the Fedora package that's making problems?
>
>
> Thanks,
> Thomas
> _______________________________________________
> gpodder-devel mailing list
> gpodder-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/gpodder-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libwget-red-hat-speed-fix.patch
Type: text/x-diff
Size: 1057 bytes
Desc: not available
URL: 
<https://lists.berlios.de/pipermail/gpodder-devel/attachments/20070117/3f98b170/attachment.patch>

Other related posts: