Skip to content

Commit e9a28ce

Browse files
committed
tools/manifestfile.py: Allow include of directory path.
If an include path is a directory, then it implicitly grabs the manifest.py file inside that directory. This simplifies most manifest.py files. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent 6bd0ec7 commit e9a28ce

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tools/manifestfile.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ def metadata(self, description=None, version=None):
198198
# TODO
199199
pass
200200

201-
def include_maybe(self, manifest_path, **kwargs):
202-
"""
203-
Include the manifest file if it exists. See docs for include().
204-
"""
205-
if os.path.exists(manifest_path):
206-
self.include(manifest_path, **kwargs)
207-
208201
def include(self, manifest_path, **kwargs):
209202
"""
210203
Include another manifest.
@@ -214,6 +207,9 @@ def include(self, manifest_path, **kwargs):
214207
215208
Relative paths are resolved with respect to the current manifest file.
216209
210+
If the path is to a directory, then it implicitly includes the
211+
manifest.py file inside that directory.
212+
217213
Optional kwargs can be provided which will be available to the
218214
included script via the `options` variable.
219215
@@ -233,6 +229,9 @@ def include(self, manifest_path, **kwargs):
233229
self.include(m)
234230
else:
235231
manifest_path = self._resolve_path(manifest_path)
232+
# Including a directory grabs the manifest.py inside it.
233+
if os.path.isdir(manifest_path):
234+
manifest_path = os.path.join(manifest_path, "manifest.py")
236235
if manifest_path in self._visited:
237236
return
238237
self._visited.add(manifest_path)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy