-
-
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
Use string.Template
when creating a new file
#21706
base: master
Are you sure you want to change the base?
Commits on Jan 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 83b20f5 - Browse repository at this point
Copy the full SHA 83b20f5View commit details -
Adds more time-related variables which can be used in the new file te…
…mplate. - `${year}`: The current year with century as a decimal number. - `${month}`: The current month as a decimal number [01,12]. - `${monthname}`: The current month's (local) name. - `${day}`: The current day of the month as decimal number [01,31].
Configuration menu - View commit details
-
Copy full SHA for 9fc35c0 - Browse repository at this point
Copy the full SHA 9fc35c0View commit details -
Uses
datetime
instead oftime
.The new `plugin.py` imports `datetime`, so we use it. IMPORTANT: When backporting, add `from datetime import datetime`!
Configuration menu - View commit details
-
Copy full SHA for baa0359 - Browse repository at this point
Copy the full SHA baa0359View commit details -
Adds even more time-related variables which can be used in the new fi…
…le template. We now have the following variables, which can be used in the new file template: - `${date}`: The date and time without timezone information. - `{$isodate}`: The date and time in ISO format (including timezone information). - `${year}`: The current year with century as a decimal number [0001,9999]. - `${month}`: The current month as a zero-padded decimal number [01,12]. - `${day}`: The current day of the month as zero-padded decimal number [01,31]. - `${hour}`: The current hour (24-hour clock) as a zero-padded decimal number [00,23]. - `${minute}`: The current minute as a zero-padded decimal number [00,59]. - `${second}`: The current second as a zero-padded decimal number [00,59]. - `${tzname}`: The local time zone name. - `${monthname}`: The current month as locale's abbreviated name. - `${weekday}`: The current weekday as locale's abbreviated name.
Configuration menu - View commit details
-
Copy full SHA for bb14240 - Browse repository at this point
Copy the full SHA bb14240View commit details -
Adds user's full name to the list of variables which can be used in t…
…he new file template. Information, how this can be done on Windows, are taken from https://sjohannes.wordpress.com/2010/06/19/win32-python-getting-users-display-name-using-ctypes/.
Configuration menu - View commit details
-
Copy full SHA for 67ea36e - Browse repository at this point
Copy the full SHA 67ea36eView commit details -
Removes heuristics when looking for the username.
Uses the OS name instead of trying to receive the 'USERNAME' environment variable, which is only available on Windows.
Configuration menu - View commit details
-
Copy full SHA for a482acb - Browse repository at this point
Copy the full SHA a482acbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f53443 - Browse repository at this point
Copy the full SHA 9f53443View commit details -
Configuration menu - View commit details
-
Copy full SHA for e354f62 - Browse repository at this point
Copy the full SHA e354f62View commit details -
Configuration menu - View commit details
-
Copy full SHA for 289ef8f - Browse repository at this point
Copy the full SHA 289ef8fView commit details -
Moves the block for creating the template variables behind the creati…
…on of the new file name. This is needed, so that we can include a filename and filepath variable to be used in the new file template.
Configuration menu - View commit details
-
Copy full SHA for 5f249a6 - Browse repository at this point
Copy the full SHA 5f249a6View commit details -
Adds file name and path to the list of variables which can be used in…
… the new file template. New template variables: - `${file}` - The full file name including the path. - `${filename}` - The file name. - `${filepath}` - The file path.
Configuration menu - View commit details
-
Copy full SHA for cc34075 - Browse repository at this point
Copy the full SHA cc34075View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b24b4b - Browse repository at this point
Copy the full SHA 0b24b4bView commit details -
Adds project name and path to the list of variables which can be used…
… in the new file template. New template variables: - `${projectname}` - The project name. - `${projectpath}` - The project directory.
Configuration menu - View commit details
-
Copy full SHA for 92f3c29 - Browse repository at this point
Copy the full SHA 92f3c29View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc1af5d - Browse repository at this point
Copy the full SHA cc1af5dView commit details -
Adds marker to position the cursor in the new file template.
The first occurance of the marker `$|$` is removed from the template and the cursor positioned in that place.
Configuration menu - View commit details
-
Copy full SHA for 059d98f - Browse repository at this point
Copy the full SHA 059d98fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e23fdfc - Browse repository at this point
Copy the full SHA e23fdfcView commit details
Commits on Jan 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5e325a4 - Browse repository at this point
Copy the full SHA 5e325a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for f082e6f - Browse repository at this point
Copy the full SHA f082e6fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ece32b7 - Browse repository at this point
Copy the full SHA ece32b7View commit details