mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 09:20:57 +01:00
Merge pull request #2729 from xonsh/xonfig_styles
Fixed a regression with xonfig styles
This commit is contained in:
commit
fbbf9ae549
3 changed files with 17 additions and 2 deletions
13
news/fix-xonfig-styles.rst
Normal file
13
news/fix-xonfig-styles.rst
Normal 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
|
|
@ -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."""
|
||||
|
|
|
@ -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."""
|
||||
|
|
Loading…
Add table
Reference in a new issue