From 17e1979e5a3f3ab1bf65f7c0b6724ff1c74376e8 Mon Sep 17 00:00:00 2001 From: MORITA Hideyuki Date: Wed, 7 Jul 2010 17:14:59 +0900 Subject: [PATCH 1/2] Bugfix: pick out a language-code from Accept-Language header. --- lib/galaxy/web/framework/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/web/framework/__init__.py b/lib/galaxy/web/framework/__init__.py index 440bce1e002..13176263059 100644 --- a/lib/galaxy/web/framework/__init__.py +++ b/lib/galaxy/web/framework/__init__.py @@ -27,6 +27,7 @@ import mako.runtime pkg_resources.require( "Babel" ) from babel.support import Translations +from babel import Locale pkg_resources.require( "SQLAlchemy >= 0.4" ) from sqlalchemy import and_ @@ -200,7 +201,7 @@ class GalaxyWebTransaction( base.DefaultWebTransaction ): if 'HTTP_ACCEPT_LANGUAGE' in self.environ: # locales looks something like: ['en', 'en-us;q=0.7', 'ja;q=0.3'] locales = self.environ['HTTP_ACCEPT_LANGUAGE'].split( ',' ) - locales = [ l.split( ';' )[0] for l in locales ] + locales = [ Locale.parse(l.split( ';' )[0], sep='-').language for l in locales ] else: # Default to English locales = 'en' From 526eaabc11dc0e10b67a3b6b62bff3136237d01c Mon Sep 17 00:00:00 2001 From: MORITA Hideyuki Date: Wed, 7 Jul 2010 17:31:48 +0900 Subject: [PATCH 2/2] Bugfix: pass the forgotten is_multi_byte argument. --- lib/galaxy/tools/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index d86a20ca050..42ebecb3878 100644 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1657,7 +1657,7 @@ class DataSourceTool( Tool ): data.extension = param_dict.get( 'data_type', data.extension ) #TODO: these should be possible as part of data_source.py and external set_meta, see the upload tool: if data.extension in [ 'txt', 'tabular' ]: - data_type = sniff.guess_ext( data.file_name, sniff_order=app.datatypes_registry.sniff_order ) + data_type = sniff.guess_ext( data.file_name, sniff_order=app.datatypes_registry.sniff_order, is_multi_byte=self.is_multi_byte ) if data.extension != data_type: data.change_datatype( data_type ) elif not isinstance( data.datatype, datatypes.interval.Bed ) and isinstance( data.datatype, datatypes.interval.Interval ):