Mercurial > traipse_dev
annotate orpg/external/std.py @ 77:6226a5f9a4b3 ornery-dev
Fixing images from last push
author | sirebral |
---|---|
date | Sat, 22 Aug 2009 04:04:25 -0500 |
parents | c54768cffbd4 |
children |
rev | line source |
---|---|
66 | 1 |
2 import sys | |
3 | |
4 class Std(object): | |
5 """ | |
6 makes all standard python modules available as a lazily | |
7 computed attribute. | |
8 """ | |
9 | |
10 def __init__(self): | |
11 self.__dict__ = sys.modules | |
12 | |
13 def __getattr__(self, name): | |
14 try: | |
15 m = __import__(name) | |
16 except ImportError: | |
17 raise AttributeError("py.std: could not import %s" % name) | |
18 return m | |
19 | |
20 std = Std() |