mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34: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():
|
||||
website_files = importlib_resources.files('website')
|
||||
for path in website_files.rglob('*.md'):
|
||||
if not any(part.startswith(('OLD', 'tmp')) or part in ('examples', '_posts') for part in path.parts):
|
||||
dump(path)
|
||||
yield str(path)
|
||||
for path in importlib_resources.files('website').iterdir():
|
||||
if path.is_file() and path.name.endswith('.md'):
|
||||
if not any(part.startswith(('OLD', 'tmp')) or part in ('examples', '_posts') for part in path.parts):
|
||||
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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue