Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: universal_exce…
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (31 sloc) 0.943 kb
#!/usr/bin/python
MODULE_DIRECTORY = 'modules.d'
LOCAL_MODULES = 'modules.local.d'
CONFIG = 'module_config.py'
outfile = 'bModules.py'
import os
def rebuild_bModules():
out = open(outfile, 'w')
# Module directory
modules = [os.path.join(MODULE_DIRECTORY, i) for i in os.listdir(MODULE_DIRECTORY)]
if os.path.exists(LOCAL_MODULES):
for i in os.listdir(LOCAL_MODULES):
modules.append(os.path.join(LOCAL_MODULES, i))
modules.sort()
modules.append(CONFIG)
for i in modules:
if not i.endswith(".py"):
continue
if os.path.isdir(i):
continue
# We're happy with the file.
for line in open(i, 'r').readlines():
out.write(line)
out.close()
return outfile
def save_modules(module_map):
pass
# XXX TODO construct this function to save to module_config.py
if __name__ == '__main__':
# Test rig
rebuild_bModules()
Jump to Line
Something went wrong with that request. Please try again.