equal
deleted
inserted
replaced
65 self.scheme = self.user = self.passwd = self.host = None |
65 self.scheme = self.user = self.passwd = self.host = None |
66 self.port = self.path = self.query = self.fragment = None |
66 self.port = self.path = self.query = self.fragment = None |
67 self._localpath = True |
67 self._localpath = True |
68 |
68 |
69 # special case for Windows drive letters |
69 # special case for Windows drive letters |
70 if path[1:2] == ':' and path[0:1].isalpha(): |
70 if has_drive_letter(path): |
71 self.path = path |
71 self.path = path |
72 return |
72 return |
73 |
73 |
74 if not path.startswith('/') and ':' in path: |
74 if not path.startswith('/') and ':' in path: |
75 parts = path.split(':', 1) |
75 parts = path.split(':', 1) |
208 return (s, (None, (str(self), self.host), |
208 return (s, (None, (str(self), self.host), |
209 self.user, self.passwd or '')) |
209 self.user, self.passwd or '')) |
210 |
210 |
211 def has_scheme(path): |
211 def has_scheme(path): |
212 return bool(url(path).scheme) |
212 return bool(url(path).scheme) |
|
213 |
|
214 def has_drive_letter(path): |
|
215 return path[1:2] == ':' and path[0:1].isalpha() |
213 |
216 |
214 def hidepassword(u): |
217 def hidepassword(u): |
215 '''hide user credential in a url string''' |
218 '''hide user credential in a url string''' |
216 u = url(u) |
219 u = url(u) |
217 if u.passwd: |
220 if u.passwd: |