Revision 142730a2 kamaki/clients/utils.py
b/kamaki/clients/utils.py | ||
---|---|---|
86 | 86 |
|
87 | 87 |
:returns: (str) a path in the form /args[0]/args[1]/... |
88 | 88 |
""" |
89 |
|
|
90 |
path = '' |
|
91 |
for arg in args: |
|
92 |
suffix = '%s' % arg |
|
93 |
try: |
|
94 |
while suffix[0] == '/': |
|
95 |
suffix = suffix[1:] |
|
96 |
except IndexError: |
|
97 |
continue |
|
98 |
if len(path) > 0 and path[-1] == '/': |
|
99 |
path += suffix |
|
100 |
else: |
|
101 |
path += '/' + suffix |
|
102 |
return path |
|
89 |
return '/'.join([''] + [arg.decode('utf-8') if ( |
|
90 |
isinstance(arg, str)) else '%s' % arg for arg in args]) |
|
103 | 91 |
|
104 | 92 |
|
105 | 93 |
def params4url(params): |
Also available in: Unified diff