Skip to content

Commit 82bf964

Browse files
author
Alistair Turnbull
committed
Rename Trees.build_path to Trees.build
1 parent 80263e9 commit 82bf964

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

nancy/__init__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,23 @@ class Trees:
125125
inputs (list[Path]): a list of filesystem `Path`s to overlay to
126126
make an abstract input tree
127127
output (Path): the filesystem `Path` of the output directory
128-
build_path (Path): the subtree of `inputs` to process.
128+
build (Path): the subtree of `inputs` to process.
129129
Defaults to the whole tree.
130130
process_hidden (bool): `True` to process hidden files (those whose
131131
names begin with ".")
132132
"""
133133

134134
inputs: list[Path]
135135
output: Path
136-
build_path: Path
136+
build: Path
137137
process_hidden: bool
138138

139139
def __init__(
140140
self,
141141
inputs: list[Path],
142142
output: Path,
143143
process_hidden: bool,
144-
build_path: Optional[Path] = None,
144+
build: Optional[Path] = None,
145145
):
146146
if len(inputs) == 0:
147147
raise ValueError("at least one input must be given")
@@ -153,11 +153,11 @@ def __init__(
153153
self.inputs = inputs
154154
self.output = output
155155
self.process_hidden = process_hidden
156-
if build_path is None:
157-
build_path = Path()
158-
if build_path.is_absolute():
156+
if build is None:
157+
build = Path()
158+
if build.is_absolute():
159159
raise ValueError("build path must be relative")
160-
self.build_path = build_path
160+
self.build = build
161161

162162
def find_root(self, obj: Path) -> Optional[Path]:
163163
"""Find the leftmost of `inputs` that contains `obj`."""
@@ -213,10 +213,10 @@ def expand(
213213
inputs: list[Path],
214214
output: Path,
215215
process_hidden: bool,
216-
build_path: Optional[Path] = None,
216+
build: Optional[Path] = None,
217217
) -> None:
218-
trees = Trees(inputs, output, process_hidden, build_path)
219-
trees.process_path(trees.build_path)
218+
trees = Trees(inputs, output, process_hidden, build)
219+
trees.process_path(trees.build)
220220

221221

222222
class Expand:
@@ -255,7 +255,7 @@ def __init__(
255255
self._macros = Macros(self)
256256

257257
# Recompute `_output_path` by expanding `path`.
258-
output_path = self.path.relative_to(self.trees.build_path)
258+
output_path = self.path.relative_to(self.trees.build)
259259
if output_path.name != "":
260260
output_path = output_path.with_name(
261261
re.sub(TEMPLATE_REGEX, "", output_path.name)
@@ -557,7 +557,7 @@ def main(argv: list[str] = sys.argv[1:]) -> None:
557557
args.process_hidden,
558558
Path(args.path) if args.path else None,
559559
)
560-
trees.process_path(trees.build_path)
560+
trees.process_path(trees.build)
561561
except Exception as err:
562562
if "DEBUG" in os.environ:
563563
logging.error(err, exc_info=True)

0 commit comments

Comments
 (0)