site 1.8.1: the boot screen names the release (Pionaarr Mods 1.8.1)
make_builder_data.py writes the site version into the credit mod's RELEASE and into the pages' and the builder's boot text on every run; new boot screen shots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
08adcfcd27
commit
5537afb53d
13 files changed
+89
-30
No files matched your search
@@ -158,12 +158,30 @@ def python_bundle(repo):
|
||||
return out
|
||||
|
||||
|
||||
def set_release(repo):
|
||||
"""The boot screen (the credit mod) names the Pionaarr Mods release: always
|
||||
the site's version (tools/changelog.json), written into credit.py's
|
||||
RELEASE before anything is built."""
|
||||
import re
|
||||
with open(os.path.join(HERE, 'changelog.json'), encoding='utf-8') as f:
|
||||
site = json.load(f)['site'][0]['version']
|
||||
path = os.path.join(repo, 'mods', 'cdj900nxs', 'credit.py')
|
||||
with open(path, encoding='utf-8') as f:
|
||||
src = f.read()
|
||||
new = re.sub(r"^RELEASE = '[^']*'", "RELEASE = '%s'" % site, src, count=1, flags=re.M)
|
||||
if new != src:
|
||||
with open(path, 'w', encoding='utf-8', newline='\n') as f:
|
||||
f.write(new)
|
||||
print('set credit.RELEASE to %s (the boot screen)' % site)
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument('--repo', default=os.path.join(os.path.dirname(WEB), 'CDJ900NXSVirtual'))
|
||||
args = ap.parse_args()
|
||||
sys.path.insert(0, os.path.join(args.repo, 'mods'))
|
||||
sys.path.insert(0, os.path.join(args.repo, 'mods', 'cdj900nxs'))
|
||||
set_release(args.repo)
|
||||
import patch_cdj900nxs as p
|
||||
import hotcuekeys as hk
|
||||
import cuecolours
|
||||
@@ -286,10 +304,19 @@ def write_versions(p):
|
||||
html = f.read()
|
||||
new = re.sub(r'(href|src)="((?:style\.css|script\.js|assets/versions\.js|builder/[a-z]+\.js))(\?v=[^"]*)?"',
|
||||
lambda m: '%s="%s?v=%s"' % (m.group(1), m.group(2), data['site']), html)
|
||||
new = re.sub(r'Pionaarr Mods \d+\.\d+(\.\d+)?', 'Pionaarr Mods ' + data['site'], new) # the boot text
|
||||
if new != html:
|
||||
with open(path, 'w', encoding='utf-8', newline='\n') as f:
|
||||
f.write(new)
|
||||
print('stamped %s with ?v=%s' % (name, data['site']))
|
||||
ui = os.path.join(WEB, 'builder', 'ui.js')
|
||||
with open(ui, encoding='utf-8') as f:
|
||||
js = f.read()
|
||||
new = re.sub(r'Pionaarr Mods \d+\.\d+(\.\d+)?', 'Pionaarr Mods ' + data['site'], js)
|
||||
if new != js:
|
||||
with open(ui, 'w', encoding='utf-8', newline='\n') as f:
|
||||
f.write(new)
|
||||
print('stamped builder/ui.js with Pionaarr Mods %s' % data['site'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in new issue
Block a user