~jbaker/storm/nose_plugin

« back to all changes in this revision

Viewing changes to storm/__init__.py

  • Committer: Gustavo Niemeyer
  • Date: 2008-06-26 11:57:22 UTC
  • mfrom: (235.2.24 need-for-speed-revenge)
  • Revision ID: gustavo@niemeyer.net-20080626115722-ekl4af6sx2pn08d0
Merging need-for-speed-revenge branch [a=niemeyer,jamesh,radix]
[r=jamesh,therve]

This branch introduces a number of fixes, optimizations, and extensions
on the cextensions module, with speedup purposes.  The module is now
built by default, but still disabled unless the STORM_CEXTENSIONS=1
environment variable is defined.

Besides these, Chris also provided a mechanism to cache ClassAliases,
to prevent the cost of rebuilding the ClassInfo for each alias.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
20
#
21
21
 
 
22
import os
 
23
 
22
24
 
23
25
version = "0.12"
24
26
version_info = tuple([int(x) for x in version.split(".")])
34
36
 
35
37
 
36
38
Undef = UndefType()
 
39
 
 
40
 
 
41
# XXX The default is 1 for now.  In the future we'll invert this logic so
 
42
#     that it's enabled by default.
 
43
has_cextensions = False
 
44
if os.environ.get("STORM_CEXTENSIONS") == "1":
 
45
    try:
 
46
        from storm import cextensions
 
47
        has_cextensions = True
 
48
    except ImportError, e:
 
49
        # XXX Once the logic is inverted and cextensions are enabled by
 
50
        #     default, use the following version so that people may opt
 
51
        #     to use and distribute the pure Python version.
 
52
        #if "cextensions" not in str(e):
 
53
        #    raise
 
54
        raise