Skip to content
Snippets Groups Projects
Commit 0ad5f9df authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Version 2014-07-30 16:55

parent c2afcf4f
No related branches found
No related tags found
No related merge requests found
......@@ -122,9 +122,25 @@ class Mirror:
def expand_mirror(path):
def unique_id(path):
all = set(path)
N = 0
while True:
N = N + 1
result = {}
test = set()
for p in all:
name = '__'.join(p[0].split('/')[-N:])
if name in test:
break
test.update(name)
result[p] = name
break
return result
class Info:
def __init__(self, id, path, urls):
self.id = 'repo_%d' % id
self.id = id
self.path = path
self.urls = urls
pass
......@@ -134,8 +150,10 @@ def expand_mirror(path):
self.urls)
pass
result = []
for p,i in zip(path, range(len(path))):
result.append(Info(i, p, mirror[p].urls))
id = unique_id(path)
for p in path:
result.append(Info(id[p], p, mirror[p].urls))
return result
def cleanup():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment