1
2
3
4
5 """Collection of modules for dealing with biological data in Python.
6
7 The Biopython Project is an international association of developers
8 of freely available Python tools for computational molecular biology.
9
10 http://biopython.org
11 """
12
15
17 import sys, os
18 from Bio.config.Registry import Registry
19
20 if getattr(sys, "version_info", (1, 5))[:2] < (2, 1):
21 return
22
23 self = sys.modules[__name__]
24
25
26
27
28 config_imports = __import__("Bio.config", {}, {}, ["Bio"])
29
30 if hasattr(config_imports, '__loader__'):
31 zipfiles = __import__("Bio.config", {}, {}, ["Bio"]).__loader__._files
32
33 x = [zipfiles[file][0] for file in zipfiles.keys() \
34 if 'Bio\\config' in file]
35 x = [name.split("\\")[-1] for name in x]
36 x = map(lambda x: x[:-4], x)
37
38 else:
39 x = os.listdir(os.path.dirname(config_imports.__file__))
40 x = filter(lambda x: not x.startswith("_") and x.endswith(".py"), x)
41 x = map(lambda x: x[:-3], x)
42 for module in x:
43 module = __import__("Bio.config.%s" % module, {}, {}, ["Bio","config"])
44 for name, obj in module.__dict__.items():
45 if name.startswith("_") or not isinstance(obj, Registry):
46 continue
47 setattr(self, name, obj)
48
49
50
51
52
53
54
55
56
57
58
59
60
61 del _load_registries
62