mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-11 08:47:48 -06:00
🔧 Add date, version to Config Export
This commit is contained in:
parent
4c9146cffd
commit
b7fd046d59
6 changed files with 50 additions and 130 deletions
|
@ -18,7 +18,7 @@ def apply_opt(name, val, conf=None):
|
|||
if name == "lcd": name, val = val, "on"
|
||||
|
||||
# Create a regex to match the option and capture parts of the line
|
||||
regex = re.compile(r'^(\s*)(//\s*)?(#define\s+)(' + name + r'\b)(\s*)(.*?)(\s*)(//.*)?$', re.IGNORECASE)
|
||||
regex = re.compile(rf'^(\s*)(//\s*)?(#define\s+)({name}\b)(\s*)(.*?)(\s*)(//.*)?$', re.IGNORECASE)
|
||||
|
||||
# Find and enable and/or update all matches
|
||||
for file in ("Configuration.h", "Configuration_adv.h"):
|
||||
|
@ -87,6 +87,9 @@ def fetch_example(path):
|
|||
if path.endswith("/"):
|
||||
path = path[:-1]
|
||||
|
||||
if '@' in path:
|
||||
path, brch = map(strip, path.split('@'))
|
||||
|
||||
url = path.replace("%", "%25").replace(" ", "%20")
|
||||
if not path.startswith('http'):
|
||||
url = "https://raw.githubusercontent.com/MarlinFirmware/Configurations/bugfix-2.1.x/config/%s" % url
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue