head	1.3;
access;
symbols
	RELEASE_4_6_2:1.2
	RELEASE_4_6_1:1.2
	RELEASE_4_6_0:1.2
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1;
locks; strict;
comment	@# @;


1.3
date	2002.06.18.02.46.31;	author mi;	state dead;
branches;
next	1.2;

1.2
date	2002.04.03.16.34.33;	author mi;	state Exp;
branches;
next	1.1;

1.1
date	2001.07.19.16.34.13;	author mi;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Remove the linbot port. The author stopped development after the
company behind linKbot claimed trademark violations. Fortunately,
Mike W. Meyer picked it up, and the newly renamed and improved
version is now known as www/webcheck.
@
text
@--- myUrlLib.py	Sun Mar 14 14:24:20 1999
+++ myUrlLib.py	Wed Apr  3 10:52:19 2002
@@@@ -37,6 +38,7 @@@@
 import htmlparse
 import debugio
 import sys
+import socket
 
 
 def get_robots(location):
@@@@ -77,7 +79,7 @@@@
 	self.init()
 
 	debugio.write('\tparent = ' + str(parent),2)
-	from urlparse import *
+	from urlparse import urlparse
 
 	parsed = urlparse(url)
 	self.scheme = parsed[0]
@@@@ -105,7 +107,10 @@@@
 	
 	if (parent is None):
 	    Link.baseurl=self.URL
-	    Link.base=self.URL[:string.rfind(self.URL,'/')+1]
+	    if hasattr(self.URL, 'rfind'):
+		Link.base=self.URL[:self.URL.rfind('/')+1]
+	    else:
+		Link.base=self.URL[:string.rfind(self.URL,'/')+1]
 	    if Link.base[-2:] == '//': Link.base = self.URL
 	    debugio.write('\tbase: %s' % Link.base)
 	    if self.scheme == 'http':
@@@@ -257,7 +262,7 @@@@
 
 def is_external(url):
     """ returns true if url is an external link """
-    from urlparse import *
+    from urlparse import urlparse
     parsed = urlparse(url)
     scheme = parsed[0]
     location = parsed[1]
--- robotparser.py	Sat Jan  9 19:01:45 1999
+++ robotparser.py	Wed Jul 18 20:29:13 2001
@@@@ -37,7 +37,7 @@@@
 	self.parse(urlopener.open(self.url).readlines())
 
     def parse(self, lines):
-	import regsub, string, regex
+	import re, string
 	active = []
 	for line in lines:
 	    if self.debug: print '>', line,
@@@@ -49,7 +49,7 @@@@
 	    line = string.strip(line[:string.find(line, '#')])
 	    if not line:
 		continue
-	    line = regsub.split(line, ' *: *')
+	    line = re.split(' *: *', line)
 	    if len(line) == 2:
 		line[0] = string.lower(line[0])
 		if line[0] == 'user-agent':
@@@@ -62,7 +62,7 @@@@
 		    if line[1]:
 			if self.debug: print '>> disallow:', line[1]
 			for agent in active:
-			    self.rules[agent].append(regex.compile(line[1]))
+			    self.rules[agent].append(re.compile(line[1]))
 		    else:
 			pass
 			for agent in active:
@@@@ -83,7 +83,7 @@@@
 	    return 1
 	path = urlparse.urlparse(url)[2]
 	for rule in self.rules[ag]:
-	    if rule.match(path) != -1:
+	    if rule.match(path):
 		if self.debug: print '>> disallowing', url, 'fetch by', agent
 		return 0
 	if self.debug: print '>> allowing', url, 'fetch by', agent
--- schemes/filelink.py	Thu Mar 11 22:56:07 1999
+++ schemes/filelink.py	Wed Jul 18 20:19:26 2001
@@@@ -42,7 +42,7 @@@@
 import time
 import mimetypes
 import myUrlLib
-import regsub
+import re
 
 mimetypes.types_map['.shtml']='text/html'
 
@@@@ -51,7 +51,7 @@@@
     parsed = urlparse.urlparse(self.URL,'file',0)
     filename = parsed[2]
     if os.name != 'posix':
-	filename = regsub.sub("^/\(//\)?\([a-zA-Z]\)[|:]","\\2:",filename)
+	filename = re.sub("^/\(//\)?\([a-zA-Z]\)[|:]","\\2:",filename)
     try:
 	stats = os.stat(filename)
     except os.error:
@@@@ -70,7 +70,7 @@@@
     parsed = urlparse.urlparse(url,'file',0)
     filename = parsed[2]
     if os.name != 'posix':
-	filename = regsub.sub("^/\(//\)?\([a-zA-Z]\)[|:]","\\2:",filename)
+	filename = re.sub("^/\(//\)?\([a-zA-Z]\)[|:]","\\2:",filename)
     
     return open(filename,'r').read()
     
--- htmlparse.py	Wed Mar 10 23:51:25 1999
+++ htmlparse.py	Wed Apr  3 11:10:55 2002
@@@@ -48,5 +48,5 @@@@
     based on parent"""
     
-    from urlparse import *
+    from urlparse import urlparse
     
     method=urlparse(url)[0]
@@@@ -125,5 +125,5 @@@@
     the <BASE HREF=> tag."""
     import htmllib
-    from urlparse import *
+    from urlparse import urlparse
     from formatter import NullFormatter
 
@


1.2
log
@Tidy up ``import'' statements to avoid warnings by the latest Python-2.2.
When de-installing, try removing any .pyc or .pyo files generated by
Python compiler next to the .py files we install.

Not bumping up PORTREVISION, since it still does not work with the new
Python and worked without the fixes with the earlier one.

Submitted by:	maintainer
@
text
@@


1.1
log
@Add another  patch (by Mike Meyer),  who answered my call  for a
Python guru and fixed the linbot to work under modern version of
Python (as well  as the 1.5). He also replaced  regex and regsub
with  the  re  module,  which  seems  to  make  it  work  better
with  no-ascii  web-pages  too  (a nice  side-effect).  Bump  up
PORTREVISION and  give MAINTAINERship to  Mike (he *did*  see it
coming).

Obtained from:	Mike Meyer
@
text
@d1 3
a3 4
diff -ru /tmp/lb/linbot-1.0/myUrlLib.py ./myUrlLib.py
--- myUrlLib.py	Sun Mar 14 13:24:20 1999
+++ myUrlLib.py	Wed Jul 18 20:42:57 2001
@@@@ -37,6 +37,7 @@@@
d11 10
a20 1
@@@@ -105,7 +106,10 @@@@
d32 9
d108 16
@

