1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/17caba3f5b80/ changeset: 17caba3f5b80 user: dannon date: 2012-02-24 23:47:47 summary: Preliminary autopacking for javascript. Disabled by default (pack_scripts in universe_wsgi.ini) and the packed scripts are still in the distribution, to be removed at some point. affected #: 2 files diff -r ad69e258128ae3dc5a9cfe2d13b53680279b48e8 -r 17caba3f5b808bd62a96ab3076934779dd01fb77 lib/galaxy/web/buildapp.py --- a/lib/galaxy/web/buildapp.py +++ b/lib/galaxy/web/buildapp.py @@ -140,6 +140,8 @@ webapp = wrap_in_middleware( webapp, global_conf, **kwargs ) if asbool( kwargs.get( 'static_enabled', True ) ): webapp = wrap_in_static( webapp, global_conf, **kwargs ) + if asbool(kwargs.get('pack_scripts', False)): + pack_scripts() # Close any pooled database connections before forking try: galaxy.model.mapping.metadata.engine.connection_provider._pool.dispose() @@ -147,7 +149,21 @@ pass # Return return webapp - + +def pack_scripts(): + from glob import glob + from subprocess import call + cmd = "java -jar scripts/yuicompressor.jar --type js static/scripts/%(fname)s -o static/scripts/packed/%(fname)s" + raw_js= [os.path.basename(g) for g in glob( "static/scripts/*.js" )] + for fname in raw_js: + if os.path.exists('static/scripts/packed/%s' % fname): + if os.path.getmtime('static/scripts/packed/%s' % fname) > os.path.getmtime('static/scripts/%s' % fname): + continue # Skip, packed is newer than source. + d = dict( fname=fname ) + log.info("%(fname)s --> packed/%(fname)s" % d) + call( cmd % d, shell=True ) + + def wrap_in_middleware( app, global_conf, **local_conf ): """ Based on the configuration wrap `app` in a set of common and useful diff -r ad69e258128ae3dc5a9cfe2d13b53680279b48e8 -r 17caba3f5b808bd62a96ab3076934779dd01fb77 universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample +++ b/universe_wsgi.ini.sample @@ -261,6 +261,12 @@ static_style_dir = %(here)s/static/june_2007_style/blue static_robots_txt = %(here)s/static/robots.txt +# Pack javascript at launch (/static/scripts/*.js) +# This only happens if the modified timestamp of the source .js is newer +# than the version (if it exists) in /static/scripts/packed/ +# Note that this requires java > 1.4 for executing yuicompressor.jar +#pack_scripts = False + # -- Advanced proxy features # For help on configuring the Advanced proxy features, see: @@ -525,7 +531,6 @@ # be used for each "Set at Runtime" input, independent of others in the Workflow #enable_unique_workflow_defaults = False - # -- Job Execution # If running multiple Galaxy processes, one can be designated as the job @@ -673,4 +678,5 @@ #queue = galaxy_queue #exchange = galaxy_exchange #routing_key = bar_code_scanner -#rabbitmqctl_path = /path/to/rabbitmqctl +#rabbitmqctl_path = /path/to/rabbitmqctl + Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.