don't disrupt \_ in filenames #1158

This commit is contained in:
Paul Gauthier 2024-08-26 12:08:46 -07:00
parent 8c766f81b2
commit 4b2227c71f
4 changed files with 34 additions and 3 deletions

View file

@ -415,7 +415,9 @@ def strip_filename(filename, fence):
filename = filename.strip() filename = filename.strip()
filename = filename.strip("`") filename = filename.strip("`")
filename = filename.strip("*") filename = filename.strip("*")
filename = filename.replace("\\_", "_")
# https://github.com/paul-gauthier/aider/issues/1158
# filename = filename.replace("\\_", "_")
return filename return filename

View file

@ -30,8 +30,6 @@ def process_markdown(filename, fh):
# Split the content into sections based on '####' headers # Split the content into sections based on '####' headers
sections = re.split(r"(?=####\s)", content) sections = re.split(r"(?=####\s)", content)
dump(sections)
for section in sections: for section in sections:
if "editblock_coder.py" in section or "test_editblock.py" in section: if "editblock_coder.py" in section or "test_editblock.py" in section:
continue continue

View file

@ -27799,3 +27799,12 @@ echo "$message"
@@@ SHELL @@@@@@@@@@@@@@@@@@@@ @@@ SHELL @@@@@@@@@@@@@@@@@@@@
bash example.sh bash example.sh
@@@ ENDSHELL @@@@@@@@@@@@@@@@@@@@ @@@ ENDSHELL @@@@@@@@@@@@@@@@@@@@
@@@ #### make the change from https://github.com/paul-gauthier/aider/issues/1158 @@@@@@@@@@@@@@@@@@@@
@@@ SEARCH: src\mycli\dev\__init__.py @@@@@@@@@@@@@@@@@@@@
from .tools import *
@@@@@@@@@@@@@@@@@@@@
from .tools import *
from .project import newpy
@@@ REPLACE @@@@@@@@@@@@@@@@@@@@

View file

@ -1,3 +1,4 @@
-*- mode: fundamental -*-
> >
> isort....................................................................Passed > isort....................................................................Passed
> black....................................................................Passed > black....................................................................Passed
@ -99937,3 +99938,24 @@ world!
The here-doc approach makes it easier to add or modify multi-line messages in the future, and it's more readable than escaping newlines in a single string. The here-doc approach makes it easier to add or modify multi-line messages in the future, and it's more readable than escaping newlines in a single string.
#### make the change from https://github.com/paul-gauthier/aider/issues/1158
Thank you for adding the file. Now I can propose the necessary changes. We need to update the `src\mycli\dev\__init__.py` file to import the `newpy` function from the `project` module. Here's the change:
src\mycli\dev\__init__.py
<source>python
<<<<<<< SEARCH
from .tools import *
=======
from .tools import *
from .project import newpy
>>>>>>> REPLACE
</source>
This change imports the `newpy` function from the `project` module, making it available when importing from the `dev` package.
Now, the `newpy` command should be properly imported and accessible in the main CLI file.
Is there anything else you'd like me to do or explain regarding this change?