Skip to content

Commit

Permalink
Merge pull request #2693 from getnikola/nikola-plugin-list-readability
Browse files Browse the repository at this point in the history
Fix #2692 -- make `nikola plugin --list-installed` more readable
  • Loading branch information
Kwpolska committed Mar 12, 2017
2 parents a40fdd9 + 3eec374 commit 8e867cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions nikola/plugins/command/plugin.py
Expand Up @@ -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):
Expand Down

0 comments on commit 8e867cc

Please sign in to comment.