-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
template.py editing is cumbersome and underdocumented #2884
Comments
It's an interesting idea. I'm marking it as doable for a future Spyder version. |
I got the idea from Eclipse. This concept is really good I think. There are more generic templates, for code, and for comments too, depending on which context. PyDev comments of new modules look like
But this is completely configurable within the preferences dialog. And furthermore, you could add optional default LICENSE headers, that are added to each file at the top. |
If we are going in this direction let's use jinja2. It is already a (indirect) dependency for spyder and is a well defined and documented templating language. |
Ok - isn't that a bit overkill, using a whole template language with loops etc, for just having a few variables? It could be done by just replacing |
We start with few variables and after some months we end up having to maintain and document a "simple home made template language"... not a chance. I prefer having an "overkill" (well defined proven stable and maintained) template language, that already is included when spyder is installed, than having to put a burden (however minimal) on the developer team |
Eclipse did it like that and that probably makes sense for Eclipse, (which is coded in Java) @ccordoba12 I am 👎 on implementing things like |
Ok, FULL ACK. Seems really comprehensible. |
Python has a string template, which is proven stable and maintained, and is not overkill. Using jinja to replace a few variables is really overkill, it's better to keep it as an indirect dependency rather than a hard one. |
Agree with @Nodd, we can use string template ;-) |
Hi, has there any work done on this? I would love to contribute with this. |
Nop, you're welcome to work on it. Please read our Contributing guide before starting: https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md |
File Name: |
Having usable variables like PyCharm's would be good, especially the configurable ones. For instance, my group anaconda's python in a standardized location, but can be changed based on an environment variable, or is updated (and renamed to reflect) when new features are added, so having the ability to read an environment variable to generate the shebang would be nice. |
bump!
|
Currently, only the
%(date)s
and%(username)s
variables in template.py are replaced.There should be some generic other variables like
%(projectname)s
and others.AND - the documentation for that is missing.
What I would do here:
Let the user edit this file (template.py) in the settings (instead of this button "edit template for new modules") and put some explanations there, what the variables are for etc.
The text was updated successfully, but these errors were encountered: