Merge pull request #2729 from xonsh/xonfig_styles

Fixed a regression with xonfig styles
This commit is contained in:
Anthony Scopatz 2018-07-19 18:03:02 -04:00 committed by GitHub
commit fbbf9ae549
Failed to generate hash of commit
3 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,13 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Fixed a regression with ``xonfig styles`` reporting ``AttributeError: module 'pygments' has no attribute 'styles'``
**Security:** None

View file

@ -279,7 +279,8 @@ class PromptToolkitShell(BaseShell):
"""Returns an iterable of all available style names."""
if not HAS_PYGMENTS:
return ['For other xonsh styles, please install pygments']
return pygments.styles.get_all_styles()
from pygments.styles import get_all_styles
return get_all_styles()
def color_style(self):
"""Returns the current color map."""

View file

@ -286,7 +286,8 @@ class PromptToolkit2Shell(BaseShell):
"""Returns an iterable of all available style names."""
if not HAS_PYGMENTS:
return ['For other xonsh styles, please install pygments']
return pygments.styles.get_all_styles()
from pygments.styles import get_all_styles
return get_all_styles()
def color_style(self):
"""Returns the current color map."""