Package buildslave :: Module util
[frames] | no frames]

Source Code for Module buildslave.util

 1  import time 
 2   
3 -def remove_userpassword(url):
4 if '@' not in url: 5 return url 6 if '://' not in url: 7 return url 8 9 # urlparse would've been nice, but doesn't support ssh... sigh 10 protocol_url = url.split('://') 11 protocol = protocol_url[0] 12 repo_url = protocol_url[1].split('@')[-1] 13 14 return protocol + '://' + repo_url
15 16
17 -def now(_reactor=None):
18 if _reactor and hasattr(_reactor, "seconds"): 19 return _reactor.seconds() 20 else: 21 return time.time()
22