1"""Tools for creating command-line and web-based wizards from a tree of nodes. 2"""
3import os
4import re
53
54
55class Question(Node):
56 """Asks a question and then chooses the next node based on the response. 57 """
58
59 attrs = ("question", "responses", "converter", "path")
209
210 @property
211 def paths(self):
212 """ 213 Returns the list of directories that this EnvPath contains.
214 """
215 return list(self)
940
941
942def display_error_message(strip_xonsh_error_types=True):
943 """ 944 Prints the error message of the current exception on stderr.
945 """
946 exc_type, exc_value, exc_traceback = sys.exc_info()
951
952
953def is_writable_file(filepath):
954 """ 955 Checks if a filepath is valid for writing.
956 """
957 filepath = expand_path(filepath)
If a docstring fits in a single line (72 characters according to PEP8), it is recommended to have the quotes on the same line.
def foo():
"""
Runs bar and returns baz.
"""
baz = bar()
return baz
def foo():
"""Runs bar and returns baz."""
baz = bar()
return baz