mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
commit
36deaeeb4e
2 changed files with 25 additions and 0 deletions
13
news/pretty_path.rst
Normal file
13
news/pretty_path.rst
Normal file
|
@ -0,0 +1,13 @@
|
|||
**Added:**
|
||||
|
||||
* Pretty printing of the $PATH variable
|
||||
|
||||
**Changed:** None
|
||||
|
||||
**Deprecated:** None
|
||||
|
||||
**Removed:** None
|
||||
|
||||
**Fixed:** None
|
||||
|
||||
**Security:** None
|
|
@ -204,6 +204,18 @@ class EnvPath(collections.MutableSequence):
|
|||
return False
|
||||
return all(map(operator.eq, self, other))
|
||||
|
||||
def _repr_pretty_(self, p, cycle):
|
||||
""" Pretty print path list """
|
||||
if cycle:
|
||||
p.text('EnvPath(...)')
|
||||
else:
|
||||
with p.group(1, 'EnvPath(\n[', ']\n)'):
|
||||
for idx, item in enumerate(self):
|
||||
if idx:
|
||||
p.text(',')
|
||||
p.breakable()
|
||||
p.pretty(item)
|
||||
|
||||
|
||||
class DefaultNotGivenType(object):
|
||||
"""Singleton for representing when no default value is given."""
|
||||
|
|
Loading…
Add table
Reference in a new issue