mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
Improved the get_package_files()
function to handle the MultiplexedPath
object and avoid the AttributeError
.
This commit is contained in:
parent
4ad6eef1a3
commit
4030fdb574
1 changed files with 10 additions and 4 deletions
|
@ -15,10 +15,16 @@ warnings.simplefilter("ignore", category=FutureWarning)
|
||||||
|
|
||||||
def get_package_files():
|
def get_package_files():
|
||||||
website_files = importlib_resources.files('website')
|
website_files = importlib_resources.files('website')
|
||||||
for path in website_files.rglob('*.md'):
|
for path in importlib_resources.files('website').iterdir():
|
||||||
if not any(part.startswith(('OLD', 'tmp')) or part in ('examples', '_posts') for part in path.parts):
|
if path.is_file() and path.name.endswith('.md'):
|
||||||
dump(path)
|
if not any(part.startswith(('OLD', 'tmp')) or part in ('examples', '_posts') for part in path.parts):
|
||||||
yield str(path)
|
dump(path)
|
||||||
|
yield str(path)
|
||||||
|
elif path.is_dir():
|
||||||
|
for subpath in path.rglob('*.md'):
|
||||||
|
if not any(part.startswith(('OLD', 'tmp')) or part in ('examples', '_posts') for part in subpath.parts):
|
||||||
|
dump(subpath)
|
||||||
|
yield str(subpath)
|
||||||
|
|
||||||
|
|
||||||
def fname_to_url(filepath):
|
def fname_to_url(filepath):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue