cc-4105: removed extraneous requests being made to airtime when metadata is modified

This commit is contained in:
Rudi Grinberg 2012-08-02 16:41:50 -04:00
parent 7c2ecf3753
commit 4a94c55e3c
3 changed files with 42 additions and 2 deletions

View file

@ -337,6 +337,22 @@ def sub_path(directory,f):
common = os.path.commonprefix([ directory, normpath(f) ])
return common == normalized
def auto_enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
def enum(**enums):
"""
>>> MyEnum = enum(ONE=1, TWO=2, THREE='three')
>>> MyEnum.ONE
1
>>> MyEnum.TWO
2
>>> MyEnum.THREE
'three'
"""
return type('Enum', (), enums)
if __name__ == '__main__':
import doctest
doctest.testmod()