Sha256: fefb416ecdcf04a2b116c92e41159df464cd6a2d774f031f769498c9a2f7311c

Contents?: true

Size: 1.32 KB

Versions: 4

Compression:

Stored size: 1.32 KB

Contents

#!/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('PlotKit/PlotKit.js').read()
if len(sys.argv) > 1:
    outf = sys.stdout
else:
    outf = file('PlotKit/PlotKit_Packed.js', 'w')
VERSION = re.search(
    r"""(?mxs)PlotKit.PlotKit.VERSION\s*=\s*['"]([^'"]+)""",
    mk
).group(1)
if len(sys.argv) > 1:
    SUBMODULES = sys.argv[1:]
else:
    SUBMODULES = map(str.strip, re.search(
        r"""(?mxs)PlotKit.PlotKit.SUBMODULES\s*=\s*\[([^\]]+)""",
        mk
    ).group(1).replace(' ', '').replace('"', '').split(','))

alltext = '\n'.join(
    [file('PlotKit/%s.js' % m).read() for m in SUBMODULES])

tf = file('_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, """/***

    PlotKit.PlotKit %(VERSION)s : PACKED VERSION

    THIS FILE IS AUTOMATICALLY GENERATED.  If creating patches, please
    diff against the source tree, not this file.

    For more information, <http://www.liquidx.net/plotkit/>.
    
    Copyright (c) 2006. Alastair Tse.

***/
""" % locals()
shutil.copyfileobj(p.stdout, outf)
outf.write('\n')
outf.flush()
outf.close()
tf.close()
os.remove(tf.name)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
old_sql-1.16.0 public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py
old_sql-1.15.0 public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py
old_sql-1.14.0 public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py
old_sql-1.13.0 public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py