root/galaxy-central/static/scripts/pack_scripts.py

リビジョン 2, 0.8 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

  • 属性 svn:executable の設定値 *
行番号 
1#!/usr/bin/env python
2
3import sys
4
5from glob import glob
6from subprocess import call
7from shutil import copyfile
8from os import path
9
10# Scripts that should not be packed -- just copied
11do_not_pack = set()
12
13cmd = "java -jar ../../scripts/yuicompressor.jar --type js %(fname)s -o packed/%(fname)s"
14# cmd = "java -jar ../../scripts/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --js %(fname)s --js_output_file packed/%(fname)s"
15
16# If specific scripts specified on command line, just pack them, otherwise pack
17# all.
18
19if len( sys.argv ) > 1:
20    to_pack = sys.argv[1:]
21else:
22    to_pack = glob( "*.js" )
23
24for fname in to_pack:
25    d = dict( fname=fname )
26    print "%(fname)s --> packed/%(fname)s" % d
27    if fname in do_not_pack:
28        copyfile( fname, path.join( 'packed', fname ) )
29    else:
30        out = call( cmd % d, shell=True )
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。