Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Webchecker Usage - a problem with local usage

Reply
Thread Tools

Webchecker Usage - a problem with local usage

 
 
Colin J. Williams
Guest
Posts: n/a
 
      02-25-2004
I have material on a local PC which I upload to a web server.

I would like to use webchecker to check both the local linkage and that
at the remote server.

All works well when I check the remote server: http://www3.sympatico.
.... The URL for the index.html.

However, only the index.html is read when using: file:C:\\Python23/
.... The URL for the index.html.

The problem arises in the Checker method, where the basic structure of
the url has been changed. It no longer contains the root:

def inroots(self, url):
for root in self.roots:
if url[:len(root)] == root:
return self.isallowed(root, url)
return 0

It appears to be caused at urlparse lines 129 and 130, where three '/'
characters are prepended to the URL.

By commenting out lines 128, 128 and 130 of urlparse, I get the same
report for the local files that I get from the web server.

I don't like modifying a library routine, even a local copy and would
appreciate advice.

Thanks.

Colin W.

 
Reply With Quote
 
 
 
 
Colin J. Williams
Guest
Posts: n/a
 
      02-26-2004
Colin J. Williams wrote:
> I have material on a local PC which I upload to a web server.
>
> I would like to use webchecker to check both the local linkage and that
> at the remote server.
>
> All works well when I check the remote server: http://www3.sympatico.
> .... The URL for the index.html.
>
> However, only the index.html is read when using: file:C:\\Python23/
> .... The URL for the index.html.
>
> The problem arises in the Checker method, where the basic structure of
> the url has been changed. It no longer contains the root:
>
> def inroots(self, url):
> for root in self.roots:
> if url[:len(root)] == root:
> return self.isallowed(root, url)
> return 0
>
> It appears to be caused at urlparse lines 129 and 130, where three '/'
> characters are prepended to the URL.
>
> By commenting out lines 128, 128 and 130 of urlparse, I get the same
> report for the local files that I get from the web server.
>
> I don't like modifying a library routine, even a local copy and would
> appreciate advice.
>
> Thanks.
>
> Colin W.
>

Unfortunately, the change to urlparse has an unintended side-effect.

It prevents the check of any external links from the local machine.

Colin W.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Licence for webchecker module? Kevin Walzer Python 0 05-13-2007 12:17 AM
.NET 2.0: Sending email on local domain to local exchange 2K server Jim in Arizona ASP .Net 8 01-24-2006 05:37 PM
Access local port or Running local exe file =?Utf-8?B?WVNVVA==?= ASP .Net 0 01-14-2006 12:41 AM
Browser link to local file works when local, not work when servedfrom http lurker HTML 1 04-05-2005 05:10 AM
Can't use 'local' to find sql server instances on local machine karim ASP .Net 1 06-26-2003 09:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57