Skip to content

Commit

Permalink
Merge pull request #1824 from getnikola/fix-1823
Browse files Browse the repository at this point in the history
Fix part of 1823
  • Loading branch information
Kwpolska committed Jun 30, 2015
2 parents f330a1c + 93591bb commit 5a7a9e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -23,6 +23,7 @@ Features
Bugfixes
--------

* Read configuration when importing into an existing site (Issue #1823)
* Don’t crash on non-UTF-8 files during sitemap generation (Issue #1842)
* Unnecessary rebuilds of yearly archives (Issue #1833)
* Quietly ignore non-existent files in ``nikola check -l`` (Issue #1831)
Expand Down
4 changes: 2 additions & 2 deletions nikola/__main__.py
Expand Up @@ -108,7 +108,8 @@ def main(args=None):
root = get_root_dir()
if root:
os.chdir(root)
needs_config_file = (argname != 'help')
# Help and imports don't require config, but can use one if it exists
needs_config_file = (argname != 'help') and not argname.startswith('import_')
else:
needs_config_file = False

Expand Down Expand Up @@ -154,7 +155,6 @@ def main(args=None):
config['__quiet__'] = quiet
config['__configuration_filename__'] = conf_filename
config['__cwd__'] = original_cwd

site = Nikola(**config)
DN = DoitNikola(site, quiet)
if _RETURN_DOITNIKOLA:
Expand Down
11 changes: 5 additions & 6 deletions nikola/nikola.py
Expand Up @@ -615,12 +615,11 @@ def __init__(self, **config):
self.default_lang = self.config['DEFAULT_LANG']
self.translations = self.config['TRANSLATIONS']

if self.configured:
locale_fallback, locale_default, locales = sanitized_locales(
self.config.get('LOCALE_FALLBACK', None),
self.config.get('LOCALE_DEFAULT', None),
self.config.get('LOCALES', {}), self.translations)
utils.LocaleBorg.initialize(locales, self.default_lang)
locale_fallback, locale_default, locales = sanitized_locales(
self.config.get('LOCALE_FALLBACK', None),
self.config.get('LOCALE_DEFAULT', None),
self.config.get('LOCALES', {}), self.translations)
utils.LocaleBorg.initialize(locales, self.default_lang)

# BASE_URL defaults to SITE_URL
if 'BASE_URL' not in self.config:
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/command/import_wordpress.py
Expand Up @@ -184,7 +184,7 @@ def show_info_about_mising_module(modulename):

# Add tag redirects
for tag in self.all_tags:
tag = utils.slugify(tag.decode('utf8'))
tag = tag.decode('utf8')
src_url = '{}tag/{}'.format(self.context['SITE_URL'], tag)
dst_url = self.site.link('tag', tag)
if src_url != dst_url:
Expand Down

0 comments on commit 5a7a9e8

Please sign in to comment.