Files
tubestation/testing/taskcluster/taskcluster_graph/slugidjar.py
Peter Moore 85d6816a91 Bug 1194767 - use slugid 1.0.6 in ./mach taskcluster-graph command. r=wcosta
This included adding the slugid 1.0.6 python source code in /python since slugid
is now a dependency of the ./mach taskcluster-graph command, as well us updating
references that used it. Previously the implementation was in-tree.
2015-09-04 17:59:34 +02:00

21 lines
531 B
Python

from slugid import nice as slugid
class SlugidJar():
'''
Container of seen slugid's used to implement the as_slugid functionality
used in the task graph templates.
'''
def __init__(self):
self._names = {}
def __call__(self, name):
'''
So this object can easily be passed to mustache we allow it to be called
directly...
'''
if name in self._names:
return self._names[name];
self._names[name] = slugid()
return self._names[name]