Skip to content
Permalink
Browse files

Merge pull request #2693 from getnikola/nikola-plugin-list-readability

Fix #2692 -- make `nikola plugin --list-installed` more readable
  • Loading branch information
Kwpolska committed Mar 12, 2017
2 parents a40fdd9 + 3eec374 commit 8e867cc9506f209e6c70074564d46b38f210de29
Showing with 12 additions and 2 deletions.
  1. +1 −0 CHANGES.txt
  2. +11 −2 nikola/plugins/command/plugin.py
@@ -4,6 +4,7 @@ New in master
Features
--------

* Make ``nikola plugin --list-installed`` more readable (Issue #2692)
* Accept ``now`` in post-list date conditions
* Add ``RSS_COPYRIGHT``, ``RSS_COPYRIGHT_PLAIN``, and
``RSS_COPYRIGHT_FORMATS`` options in conf.py which can be disabled
@@ -179,9 +179,18 @@ def list_installed(self):
plugins.sort()
print('Installed Plugins:')
print('------------------')
maxlength = max(len(i[0]) for i in plugins)
if self.site.colorful:
formatstring = '\x1b[1m{0:<{2}}\x1b[0m at {1}'
else:
formatstring = '{0:<{2}} at {1}'
for name, path in plugins:
print('{0} at {1}'.format(name, path))
print('\n\nAlso, you have disabled these plugins: {}'.format(self.site.config['DISABLED_PLUGINS']))
print(formatstring.format(name, path, maxlength))
dp = self.site.config['DISABLED_PLUGINS']
if dp:
print('\n\nAlso, you have disabled these plugins: {}'.format(', '.join(dp)))
else:
print('\n\nNo plugins are disabled.')
return 0

def do_upgrade(self, url):

0 comments on commit 8e867cc

Please sign in to comment.
You can’t perform that action at this time.