Added the useful thinking bit of the autoupdate and tests.

This commit is contained in:
Anthony Sottile
2014-03-23 21:35:35 -07:00
parent d8f8f5e1f4
commit 49da1ba72a
5 changed files with 144 additions and 8 deletions

View File

@@ -0,0 +1,11 @@
import collections
def auto_namedtuple(classname='auto_namedtuple', **kwargs):
"""Returns an automatic namedtuple object.
Args:
classname - The class name for the returned object.
**kwargs - Properties to give the returned object.
"""
return (collections.namedtuple(classname, kwargs.keys())(**kwargs))

View File

@@ -0,0 +1,4 @@
- id: bar
name: Bar
entry: bar
language: python