diff options
Diffstat (limited to 'tools/file_packager.py')
-rw-r--r-- | tools/file_packager.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/file_packager.py b/tools/file_packager.py index b02eac24..a8448256 100644 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -48,6 +48,7 @@ has_preloaded = False in_compress = 0 pre_run = False crunch = 0 +plugins = [] for arg in sys.argv[1:]: if arg == '--preload': @@ -75,6 +76,12 @@ for arg in sys.argv[1:]: in_preload = False in_embed = False in_compress = 0 + elif arg.startswith('--plugin'): + plugin = open(arg.split('=')[1], 'r').read() + eval(plugin) # should append itself to plugins + in_preload = False + in_embed = False + in_compress = 0 elif in_preload: data_files.append({ 'name': arg, 'mode': 'preload' }) elif in_embed: @@ -120,6 +127,11 @@ def was_seen(name): return False data_files = filter(lambda file_: not was_seen(file_['name']), data_files) +# Apply plugins +for file_ in data_files: + for plugin in plugins: + plugin(file_) + # Crunch files if crunch: shutil.copyfile(shared.path_from_root('tools', 'crunch-worker.js'), 'crunch-worker.js') |