Commit 92c0711d authored by Nigel McNie's avatar Nigel McNie
Browse files

Removed the mochikit packer, no need to distribute it with Mahara and it saves about 700K of space.

parent 8cbaa798
#!/usr/bin/env python
#
# custom_rhino.jar from:
# http://dojotoolkit.org/svn/dojo/buildscripts/lib/custom_rhino.jar
#
import os
import re
import sys
import shutil
import subprocess
mk = file('htdocs/js/MochiKit/MochiKit.js').read()
if len(sys.argv) > 1:
outf = sys.stdout
else:
outf = file('htdocs/js/MochiKit/Packed.js', 'w')
VERSION = re.search(
r"""(?mxs)MochiKit.MochiKit.VERSION\s*=\s*['"]([^'"]+)""",
mk
).group(1)
if len(sys.argv) > 1:
SUBMODULES = sys.argv[1:]
else:
SUBMODULES = map(str.strip, re.search(
r"""(?mxs)MochiKit.MochiKit.SUBMODULES\s*=\s*\[([^\]]+)""",
mk
).group(1).replace(' ', '').replace('"', '').split(','))
SUBMODULES.append('MochiKit')
alltext = '\n'.join(
[file('htdocs/js/MochiKit/%s.js' % m).read() for m in SUBMODULES])
tf = file('htdocs/js/MochiKit/_scratch.js', 'w')
tf.write(alltext)
tf.flush()
p = subprocess.Popen(
['java', '-jar', 'scripts/custom_rhino.jar', '-c', tf.name],
stdout=subprocess.PIPE,
)
print >>outf, """/***
MochiKit.MochiKit %(VERSION)s : PACKED VERSION
THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please
diff against the source tree, not this file.
See <http://mochikit.com/> for documentation, downloads, license, etc.
(c) 2005 Bob Ippolito. All rights Reserved.
***/
""" % locals()
shutil.copyfileobj(p.stdout, outf)
outf.write('\n')
outf.flush()
outf.close()
tf.close()
os.remove(tf.name)
#!/bin/bash
NEWEST_FILE="`ls -1 -t htdocs/js/MochiKit/*.js | head -n1`"
PACKED_FILE="htdocs/js/MochiKit/Packed.js"
if [ ! -e ${PACKED_FILE} ] || [ ${PACKED_FILE} -ot ${NEWEST_FILE} ]; then
echo "Packing MochiKit ..."
python scripts/pack.py Base Async DOM Style Color Signal Iter Logging Position Visual DragAndDrop Format > ${PACKED_FILE}
else
echo "MochiKit packed version already up to date"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment