Mercurial > hg > config
comparison python/install_config.py @ 846:1259f9d79961
[BBB] we still in 2017 need py26 sometimes
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 17 Sep 2017 12:58:45 -0700 |
parents | 6833137f039c |
children | c4044724689a |
comparison
equal
deleted
inserted
replaced
845:70ae14b6be51 | 846:1259f9d79961 |
---|---|
28 | 28 |
29 | 29 |
30 ### standalone functions | 30 ### standalone functions |
31 | 31 |
32 def class_mapping(_type): | 32 def class_mapping(_type): |
33 """returns a dict of (name, class) for objects in the current globals() of _type""" | 33 """ |
34 return {name:cls for name, cls in globals().items() if cls.issubclass(_type)} | 34 returns a dict of (name, class) for objects |
35 in the current globals() of _type | |
36 """ | |
37 | |
38 return dict([(name,cls) | |
39 for name, cls in globals().items() if | |
40 cls.issubclass(_type)]) | |
35 | 41 |
36 | 42 |
37 def execute(*commands, **kwargs): | 43 def execute(*commands, **kwargs): |
38 """execute a series of commands""" | 44 """execute a series of commands""" |
39 for command in commands: | 45 for command in commands: |