FIX randomdir needs eid
This commit is contained in:
parent
2cce020fab
commit
0d2e28e380
1 changed files with 6 additions and 1 deletions
|
@ -39,7 +39,12 @@ def generate(spec):
|
|||
|
||||
picked = random.sample(found_files, int(spec['howmany']))
|
||||
|
||||
nick = spec.get('nick', spec.eid)
|
||||
nick = spec.get('nick', '')
|
||||
if not nick:
|
||||
if hasattr(spec, 'eid'):
|
||||
nick = spec.eid
|
||||
else:
|
||||
nick = 'NONICK'
|
||||
for path in picked:
|
||||
tmp = mkstemp(suffix=os.path.splitext(path)[-1],
|
||||
prefix='randomdir-%s-%s-' % (shortname(nick),
|
||||
|
|
Loading…
Reference in a new issue