# $Id$
-import string,os,time,sys,re
+import os,time,sys,re
from stat import *
# [D]/Name/Version/Date/Flags/Tags
def pathdata(entries, path):
"""(entries,path)
Returns the data(dict) for a specific file/dir at the path specified."""
- mysplit=string.split(path,"/")
+ mysplit=path.split("/")
myentries=entries
mytarget=mysplit[-1]
mysplit=mysplit[:-1]
continue
if line=="D": # End of entries file
break
- mysplit=string.split(line, "/")
+ mysplit=line.split("/")
if len(mysplit)!=6:
print "Confused:",mysplit
continue
from sets import Set as set
from output import *
-import htmllib,HTMLParser,string,formatter,sys,os,xpak,time,tempfile,base64,urllib2
+import htmllib,HTMLParser,formatter,sys,os,xpak,time,tempfile,base64,urllib2
try:
import cPickle
"""(baseurl,conn) --- Takes a protocol://site:port/address url, and an
optional connection. If connection is already active, it is passed on.
baseurl is reduced to address and is returned in tuple (conn,address)"""
- parts = string.split(baseurl, "://", 1)
+ parts = baseurl.split("://",1)
if len(parts) != 2:
raise ValueError, "Provided URL does not contain protocol identifier. '%s'" % baseurl
protocol,url_parts = parts
del parts
- host,address = string.split(url_parts, "/", 1)
+ host,address = url_parts.split("/",1)
del url_parts
address = "/"+address
- userpass_host = string.split(host, "@", 1)
+ userpass_host = host.split("@",1)
if len(userpass_host) == 1:
host = userpass_host[0]
userpass = ["anonymous"]
else:
host = userpass_host[1]
- userpass = string.split(userpass_host[0], ":")
+ userpass = userpass_host[0].split(":")
del userpass_host
if len(userpass) > 2:
if username and password:
http_headers = {
"Authorization": "Basic %s" %
- string.replace(
- base64.encodestring("%s:%s" % (username, password)),
+ base64.encodestring("%s:%s" % (username, password)).replace(
"\012",
""
),
if ((rc == 301) or (rc == 302)):
ignored_data = response.read()
del ignored_data
- for x in string.split(str(response.msg), "\n"):
- parts = string.split(x, ": ", 1)
+ for x in str(response.msg).split("\n"):
+ parts = x.split(": ",1)
if parts[0] == "Location":
if (rc == 301):
sys.stderr.write(red("Location has moved: ")+str(parts[1])+"\n")
if not fcmd:
return file_get_lib(baseurl,dest,conn)
- fcmd = string.replace(fcmd, "${DISTDIR}", dest)
- fcmd = string.replace(fcmd, "${URI}", baseurl)
- fcmd = string.replace(fcmd, "${FILE}", os.path.basename(baseurl))
- mysplit = string.split(fcmd)
+ fcmd = fcmd.replace("${DISTDIR}",dest)
+ fcmd = fcmd.replace("${URI}", baseurl)
+ fcmd = fcmd.replace("${FILE}", os.path.basename(baseurl))
+ mysplit = fcmd.split()
mycmd = mysplit[0]
myargs = [os.path.basename(mycmd)]+mysplit[1:]
mypid=os.fork()