Skip to content

Commit

Permalink
All plugin dirs and better Nikola path (#2113)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Feb 11, 2016
1 parent f4b38ae commit 5a6ad54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions nikola/nikola.py
Expand Up @@ -845,19 +845,19 @@ def init_plugins(self, commands_only=False):
self.plugin_manager.getPluginLocator().setPluginInfoExtension('plugin')
extra_plugins_dirs = self.config['EXTRA_PLUGINS_DIRS']
if sys.version_info[0] == 3:
places = [
self._plugin_places = [
resource_filename('nikola', 'plugins'),
os.path.join(os.getcwd(), 'plugins'),
os.path.expanduser('~/.nikola/plugins'),
] + [path for path in extra_plugins_dirs if path]
else:
places = [
self._plugin_places = [
resource_filename('nikola', utils.sys_encode('plugins')),
os.path.join(os.getcwd(), utils.sys_encode('plugins')),
os.path.expanduser('~/.nikola/plugins'),
] + [utils.sys_encode(path) for path in extra_plugins_dirs if path]

self.plugin_manager.getPluginLocator().setPluginPlaces(places)
self.plugin_manager.getPluginLocator().setPluginPlaces(self._plugin_places)
self.plugin_manager.locatePlugins()
bad_candidates = set([])
for p in self.plugin_manager._candidates:
Expand Down
7 changes: 5 additions & 2 deletions nikola/plugins/command/auto/__init__.py
Expand Up @@ -43,6 +43,7 @@
import webbrowser
from wsgiref.simple_server import make_server
import wsgiref.util
import pkg_resources

from blinker import signal
try:
Expand Down Expand Up @@ -157,7 +158,7 @@ def _execute(self, options, args):

# Do not duplicate entries -- otherwise, multiple rebuilds are triggered
watched = set([
'templates/', 'plugins/',
'templates/'
] + [get_theme_path(name) for name in self.site.THEMES])
for item in self.site.config['post_pages']:
watched.add(os.path.dirname(item[0]))
Expand All @@ -167,8 +168,10 @@ def _execute(self, options, args):
watched.add(item)
for item in self.site.config['LISTINGS_FOLDERS']:
watched.add(item)
for item in self.site._plugin_places:
watched.add(item)
# Nikola itself (useful for developers)
watched.add(os.path.dirname(nikola.__file__))
watched.add(pkg_resources.resource_filename('nikola', ''))

out_folder = self.site.config['OUTPUT_FOLDER']
if options and options.get('browser'):
Expand Down

0 comments on commit 5a6ad54

Please sign in to comment.