8000 Save as forces ".py" extension · Issue #1 · xbecas/mu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Save as forces ".py" extension #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xbecas opened this issue Jan 22, 2023 · 0 comments
Open

Save as forces ".py" extension #1

xbecas opened this issue Jan 22, 2023 · 0 comments

Comments

@xbecas
Copy link
Owner
xbecas commented Jan 22, 2023

What were you trying to do?

Save file with custom extension, other than ".py"

What steps did you take to trigger the issue?

Double click on file tab to perform a "save file as".

What did you expect to happen?

Save file with custom extension, other than ".py"

What actually happened?

Mu forces ".py" extension on the file, even if file pattern/filter is "Others (.)"

Operating System Version

macOS 12.6.2

Mu Version

1.2.1

Other Info

Follow

There are several snippets in both main.py and logic.py related to managing save filenames and managing/forcing extensions.

main.py : Windows.get_save_path():

# The file is not a . (dot) file and there's no extension, so add
# .py as default.
path += ".py"

logic.py: Editor.rename_tab():

if not self.has_python_extension(os.path.basename(new_path)):
    # No extension given, default to .
    new_path += ".pyl"

logic.py: Editor --> python_extensions defined in several places

self.python_extensions = [".py", ".pyw"]

and

pyextensions = [".pyw", ".PYW", ".py", ".PY"]

and

for mode_name, mode in self.modes.items():
    if mode.file_extensions:
    extensions += mode.file_extensions

Editor Log

No response

xbecas pushed a commit that referenced this issue Aug 26, 2023
xbecas pushed a commit that referenced this issue Aug 26, 2023
xbecas pushed a commit that referenced this issue Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0