Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 35 lines (31 sloc) 0.943 kb
df02500c »
2011-09-24 initial import
1 #!/usr/bin/python
2 MODULE_DIRECTORY = 'modules.d'
3 LOCAL_MODULES = 'modules.local.d'
4 CONFIG = 'module_config.py'
5 outfile = 'bModules.py'
6
7 import os
8
9 def rebuild_bModules():
10 out = open(outfile, 'w')
11 # Module directory
12 modules = [os.path.join(MODULE_DIRECTORY, i) for i in os.listdir(MODULE_DIRECTORY)]
13 if os.path.exists(LOCAL_MODULES):
05597b33 »
2011-09-25 Syntax fix >.<
14 for i in os.listdir(LOCAL_MODULES):
15 modules.append(os.path.join(LOCAL_MODULES, i))
df02500c »
2011-09-24 initial import
16 modules.sort()
17 modules.append(CONFIG)
18 for i in modules:
19 if not i.endswith(".py"):
20 continue
21 if os.path.isdir(i):
22 continue
23 # We're happy with the file.
24 for line in open(i, 'r').readlines():
25 out.write(line)
26 out.close()
27 return outfile
28
29 def save_modules(module_map):
30 pass
31 # XXX TODO construct this function to save to module_config.py
32
33 if __name__ == '__main__':
34 # Test rig
35 rebuild_bModules()
36
37
38
Something went wrong with that request. Please try again.