Skip to content

Commit

Permalink
Indentation fixes, import json_fix from galaxy.util.json
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Feb 20, 2016
1 parent 6653bcb commit 66bce36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
13 changes: 2 additions & 11 deletions lib/galaxy/tools/__init__.py
Expand Up @@ -49,6 +49,7 @@
from galaxy.util.bunch import Bunch
from galaxy.util.expressions import ExpressionContext
from galaxy.util.hash_util import hmac_new
from galaxy.util.json import json_fix
from galaxy.util.odict import odict
from galaxy.util import unicodify
from galaxy.util.template import fill_template
Expand Down Expand Up @@ -1852,19 +1853,8 @@ def sanitize_state( state ):
# create tool help
tool_help = ''
if self.help:
<<<<<<< 015094511b27a2267ab55621577ed05f3be092d3
tool_help = self.help.render( static_path=url_for( '/static' ), host_url=url_for( '/', qualified=True ) )
tool_help = unicodify( tool_help, 'utf-8' )
=======
tool_help = self.help
tool_help = tool_help.render( static_path=url_for( '/static' ), host_url=url_for('/', qualified=True) )
tool_help = unicodify( tool_help, 'utf-8')

# check if citations exist
tool_citations = False
if self.citations:
tool_citations = True
>>>>>>> Use unicodify

# create tool versions
tool_versions = []
Expand Down Expand Up @@ -2375,6 +2365,7 @@ def __init__( self, value ):
self.value = value


<<<<<<< 371751996916d9995b60a600a1a95456c14bdb2a
def json_fix( val ):
if isinstance( val, list ):
return [ json_fix( v ) for v in val ]
Expand Down
3 changes: 1 addition & 2 deletions lib/galaxy/web/framework/helpers/grids.py
Expand Up @@ -8,7 +8,6 @@

from galaxy.model.item_attrs import RuntimeException, UsesAnnotations, UsesItemRatings
from galaxy.util import sanitize_text
from galaxy.util import unicodify
from galaxy.util.json import loads, dumps
from galaxy.util.odict import odict
from galaxy.web.framework import decorators
Expand Down Expand Up @@ -164,7 +163,7 @@ def loads_recurse(item):
# Filter is a list; process each item.
for filter in column_filter:
if not isinstance( filter, string_types ):
filter = unicodify( filter, 'utf-8' )
text_type( filter ).encode("utf-8")
extra_url_args[ "f-" + column.key ] = dumps( column_filter )
else:
# Process singleton filter.
Expand Down
9 changes: 6 additions & 3 deletions lib/galaxy/webapps/galaxy/controllers/requests_common.py
Expand Up @@ -123,7 +123,8 @@ def sample_state_updates( self, trans, ids=None, states=None ):
if sample.state.name != state:
rval[ id ] = { "state": sample.state.name,
"html_state": unicodify( trans.fill_template( "requests/common/sample_state.mako",
sample=sample), 'utf-8' ) }
sample=sample),
'utf-8' ) }
return rval

@web.json
Expand All @@ -143,7 +144,8 @@ def sample_datasets_updates( self, trans, ids=None, datasets=None ):
if len( sample.datasets ) != number_of_datasets:
rval[ id ] = { "datasets": len( sample.datasets ),
"html_datasets": unicodify( trans.fill_template( "requests/common/sample_datasets.mako",
sample=sample), 'utf-8' ) }
sample=sample),
'utf-8' ) }
return rval

@web.json
Expand All @@ -163,7 +165,8 @@ def dataset_transfer_status_updates( self, trans, ids=None, transfer_status_list
if sample_dataset.status != transfer_status:
rval[ id ] = { "status": sample_dataset.status,
"html_status": unicodify( trans.fill_template( "requests/common/sample_dataset_transfer_status.mako",
sample_dataset=sample_dataset), 'utf-8' ) }
sample_dataset=sample_dataset),
'utf-8' ) }
return rval

@web.expose
Expand Down

0 comments on commit 66bce36

Please sign in to comment.