2 400: ("Bad Request", "Your issued HTTP request is invalid."),
3 403: ("Forbidden", "You are not authorized to view the requested resource."),
4 404: ("Not Found", "The requested resource was not found."),
5 500: ("Server Error", "An internal error occurred.")
9 return time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(ts))
14 if tz[0] != " " or (tz[1] != "+" and tz[1] != "-") or not tz[2:].isdigit():
17 tz = (((tz / 100) * 60) + (tz % 100)) * 60
18 return time.mktime(time.strptime(dstr, "%a, %d %b %Y %H:%M:%S")) - tz - time.altzone
36 if c == "&" or c == "=" or c == "#" or c == "?" or c == "/" or (ord(c) <= 32):
37 ret += "%%%02X" % ord(c)
42 def parstring(pars = {}, **augment):
50 if buf != "": buf += "&"
51 buf += urlq(key) + "=" + urlq(str(val))
53 if buf != "": buf += "&"
54 buf += urlq(key) + "=" + urlq(str(augment[key]))