Skip to content

Commit

Permalink
Literals
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed May 10, 2021
1 parent 5dad696 commit 4eab936
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions ckan/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def _create_config_object(self):
os.path.dirname(os.path.abspath(use_config_path)), path)
# Avoid circular references
if use_config_path in loaded_files:
chain = ' -> '.join(loaded_files + [use_config_path])
chain = u' -> '.join(loaded_files + [use_config_path])
raise CkanConfigurationException(
'Circular dependency located in '
'the configuration chain: {}'.format(chain)
u'Circular dependency located in '
u'the configuration chain: {}'.format(chain)
)
loaded_files.append(use_config_path)

Expand Down
6 changes: 3 additions & 3 deletions ckan/cli/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

log = logging.getLogger(__name__)

DEFAULT_HOST = "localhost"
DEFAULT_HOST = u"localhost"
DEFAULT_PORT = 5000


Expand Down Expand Up @@ -74,8 +74,8 @@ def run(ctx, host, port, disable_reloader, threaded, extra_files, processes,
else:
ssl_context = None

host = host or config.get('ckan.devserver.host', DEFAULT_HOST)
port = port or config.get('ckan.devserver.port', DEFAULT_PORT)
host = host or config.get(u'ckan.devserver.host', DEFAULT_HOST)
port = port or config.get(u'ckan.devserver.port', DEFAULT_PORT)
try:
port = int(port)
except ValueError:
Expand Down
4 changes: 2 additions & 2 deletions ckan/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ def redirect_locale(target_locale, path=None):
new_locale = locale[1]

home.add_url_rule(
'/{}/'.format(legacy_locale),
u'/{}/'.format(legacy_locale),
view_func=redirect_locale,
defaults={u'target_locale': new_locale}
)

home.add_url_rule(
'/{}/<path:path>'.format(legacy_locale),
u'/{}/<path:path>'.format(legacy_locale),
view_func=redirect_locale,
defaults={u'target_locale': new_locale}
)
6 changes: 3 additions & 3 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from ckan.cli import CKANConfigLoader
from logging.config import fileConfig as loggingFileConfig

if os.environ.get('CKAN_INI'):
config_path = os.environ['CKAN_INI']
if os.environ.get(u'CKAN_INI'):
config_path = os.environ[u'CKAN_INI']
else:
config_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), u'ckan.ini')

if not os.path.exists(config_path):
raise RuntimeError('CKAN config option not found: {}'.format(config_path))
raise RuntimeError(u'CKAN config option not found: {}'.format(config_path))

loggingFileConfig(config_path)
config = CKANConfigLoader(config_path).get_config()
Expand Down

0 comments on commit 4eab936

Please sign in to comment.