commit/galaxy-central: dannon: Eliminate simplejson for real this time. Update WebHelpers to v 1.3 (no longer requires simplejson), fix deprecated methods.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/9bc3fa17c15d/ Changeset: 9bc3fa17c15d User: dannon Date: 2014-01-13 16:54:20 Summary: Eliminate simplejson for real this time. Update WebHelpers to v 1.3 (no longer requires simplejson), fix deprecated methods. Affected #: 2 files diff -r 4eeac1dbfce3f399312e58e92d820e1153ba1a09 -r 9bc3fa17c15d00a219fe8053af4072b4a4217507 eggs.ini --- a/eggs.ini +++ b/eggs.ini @@ -26,7 +26,6 @@ pysam = 0.4.2 pysqlite = 2.5.6 python_lzo = 1.08_2.03_static -simplejson = 2.1.1 threadframe = 0.2 guppy = 0.1.8 SQLAlchemy = 0.7.9 @@ -61,7 +60,7 @@ Tempita = 0.5.1 twill = 0.9 WebError = 0.8a -WebHelpers = 0.2 +WebHelpers = 1.3 WebOb = 0.8.5 wsgiref = 0.1.2 Babel = 0.9.4 diff -r 4eeac1dbfce3f399312e58e92d820e1153ba1a09 -r 9bc3fa17c15d00a219fe8053af4072b4a4217507 lib/galaxy/web/framework/helpers/__init__.py --- a/lib/galaxy/web/framework/helpers/__init__.py +++ b/lib/galaxy/web/framework/helpers/__init__.py @@ -1,14 +1,19 @@ -import pkg_resources +""" +Galaxy web framework helpers +""" -pkg_resources.require( "WebHelpers" ) -from webhelpers import date, stylesheet_link_tag, javascript_include_tag, url_for +import time +from cgi import escape +from datetime import datetime, timedelta +from galaxy import eggs +from galaxy.util import hash_util +from galaxy.util.json import to_json_string +eggs.require( "WebHelpers" ) +from webhelpers import date +from webhelpers.html.tags import stylesheet_link, javascript_link -from galaxy.util.json import to_json_string -from galaxy.util import hash_util -from datetime import datetime, timedelta -import time - -from cgi import escape +eggs.require( "Routes" ) +from routes import url_for server_starttime = int(time.time()) @@ -25,6 +30,9 @@ return date.distance_of_time_in_words( x, datetime.utcnow() ).replace("about", "~") + " ago" def iff( a, b, c ): + """ + Ternary shortcut + """ if a: return b else: @@ -48,7 +56,7 @@ Cache-bust with time that server started running on """ - return "\n".join( [ stylesheet_link_tag( "/static/style/" + name + ".css?v=%s" % server_starttime ) for name in args ] ) + return "\n".join( [ stylesheet_link( "/static/style/" + name + ".css?v=%s" % server_starttime ) for name in args ] ) def js_helper( prefix, *args ): """ @@ -57,7 +65,7 @@ Cache-bust with time that server started running on """ - return "\n".join( [ javascript_include_tag( prefix + name + ".js?v=%s" % server_starttime ) for name in args ] ) + return "\n".join( [ javascript_link( prefix + name + ".js?v=%s" % server_starttime ) for name in args ] ) def js( *args ): """ 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.
participants (1)
-
commits-noreply@bitbucket.org