details: http://www.bx.psu.edu/hg/galaxy/rev/2df1ac94c37a changeset: 2762:2df1ac94c37a user: Kanwei Li <kanwei@gmail.com> date: Thu Sep 24 12:36:59 2009 -0400 description: fix p2.4 issue in tracks 2 file(s) affected in this change: lib/galaxy/web/controllers/tracks.py templates/root/history.mako diffs (41 lines): diff -r 3e194c33f219 -r 2df1ac94c37a lib/galaxy/web/controllers/tracks.py --- a/lib/galaxy/web/controllers/tracks.py Thu Sep 24 11:55:55 2009 -0400 +++ b/lib/galaxy/web/controllers/tracks.py Thu Sep 24 12:36:59 2009 -0400 @@ -48,9 +48,6 @@ # FIXME: hardcoding this for now, but it should be derived from the available # converters browsable_types = set( ["wig" ] ) - -# For natural sort -NUM_RE = re.compile('([0-9]+)') class TracksController( BaseController ): """ @@ -122,8 +119,14 @@ """ Returns a naturally sorted list of chroms/contigs for the given dbkey """ + def check_int(s): + if s.isdigit(): + return int(s) + else: + return s + def split_by_number(s): - return [ int(c) if c.isdigit() else c for c in NUM_RE.split(s) ] + return [ check_int(c) for c in re.split('([0-9]+)', s) ] chroms = self._chroms( trans, dbkey ) to_sort = [{ 'chrom': chrom, 'len': length } for chrom, length in chroms.iteritems()] diff -r 3e194c33f219 -r 2df1ac94c37a templates/root/history.mako --- a/templates/root/history.mako Thu Sep 24 11:55:55 2009 -0400 +++ b/templates/root/history.mako Thu Sep 24 12:36:59 2009 -0400 @@ -81,7 +81,7 @@ // Functionized so AJAX'd datasets can call them function initShowHide() { - // Load saved state and show as neccesary + // Load saved state and show as necessary try { var stored = $.jStore.store("history_expand_state"); if (stored) {