Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
schedule: Also enable banner (and verify existence of banner and chan…
Browse files Browse the repository at this point in the history
…gelog)
  • Loading branch information
jef-n committed Nov 7, 2023
1 parent 199b2e4 commit 41d05c5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
15 changes: 15 additions & 0 deletions scripts/update-schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from urllib.request import urlopen
import csv
import os
import re
import codecs
from datetime import datetime, timedelta, timezone
from icalendar import Calendar, Event
Expand Down Expand Up @@ -207,8 +209,19 @@ def adduid(ev, uid):
elif r == "NEXT":
nextversion = name

for v, n in {ltr_version: ltr_name, lr_version: lr_name}.items():
print(f"{v}:{n}")
url = "https://raw.githubusercontent.com/qgis/QGIS/release-{0}/CMakeLists.txt".format("_".join(v.split('.')[:2]))
cm = urlopen(url).read().decode('utf-8')
rn = re.search("^set\(RELEASE_NAME \"(.*)\"\)$", cm, re.MULTILINE).group(1)
assert n==rn, f"Expected {n}, found {rn}"

o = open("source/schedule.py", "w")

shortver = "".join(lr_version.split(".")[:2])
for f in [f"themes/qgis-theme/static/images/qgisorg_banner{shortver}.png", f"source/site/forusers/visualchangelog{shortver}/index.rst"]:
assert os.path.exists(f), f"{f} not found"

o.write("""\
from datetime import date
Expand All @@ -219,6 +232,7 @@ def adduid(ev, uid):
binary = '%(lr_binary)s'
releasedate = date(%(releasedate)s)
releasenote = u'%(lr_note)s'
shortver = u'%(shortver)s'
# long term release repository
ltrversion = '%(ltrversion)s'
Expand Down Expand Up @@ -246,6 +260,7 @@ def adduid(ev, uid):
"ltr_name": ltr_name.replace("'", "\\'"),
"ltr_binary": ltr_binary,
"ltr_note": ltr_note.replace("'", "\\'") if ltr_note != '' else 'LTR',
"shortver": shortver,
"devversion": devversion,
"nextversion": nextversion,
"nextfreezedate": f_date.strftime('%Y-%m-%d %H:%M:%S UTC') if f_date is not None else None,
Expand Down
2 changes: 2 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def setup(app):
app.add_config_value('ltrbinary', None, 'env')
app.add_config_value('infeaturefreeze', None, 'env')
app.add_config_value('stripeform_url', None, 'env')
app.add_config_value('shortver', None, 'env')


context = {
Expand All @@ -363,6 +364,7 @@ def setup(app):
'ltrbinary': ltrbinary,
'infeaturefreeze': infeaturefreeze,
'stripeformurl': '/stripe/form',
'shortver': shortver,
'lr_msi': f"https://qgis.org/downloads/QGIS-OSGeo4W-{release}-{binary}.msi",
'ltr_msi': f"https://qgis.org/downloads/QGIS-OSGeo4W-{ltrrelease}-{ltrbinary}.msi",
}
Expand Down
5 changes: 3 additions & 2 deletions source/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# latest release
version = '3.34'
release = '3.34.0'
codename = u'Lima'
binary = '1'
codename = u'Prizren'
binary = '2'
releasedate = date(2023, 10, 27)
releasenote = u'RC'
shortver = u'334'

# long term release repository
ltrversion = '3.28'
Expand Down
6 changes: 3 additions & 3 deletions themes/qgis-theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ <h3>

<div class="carousel-inner">
<div class="item active">
<img src="{{pathto('_static/images/qgisorg_banner334.png', 1)}}?t=nov2023" alt="QGIS 3.34">
<img src="{{pathto('_static/images/qgisorg_banner%s.png'|format(shortver), 1)}}?t={{ releasedate }}" alt="{{ _('QGIS %s')|format(version) }}" />
<div class="container">
<div class="carousel-caption">
<h5 class="caption-headline">{{ _('New release: %s!')|format( '3.34' ) }}</h5>
<h5 class="caption-headline">{{ _('New release: %s!')|format(version) }}</h5>
<p class="caption-text">
{{_('Get the') }}
<a class="caption-link" href="{{ pathto('site/forusers/download') }}" > {{_('installer or packages')}} </a>
{{_('for your Operating System and read the') }}
<a class="caption-link" href="{{ pathto('site/forusers/visualchangelog334/index') }}" > {{_('changelog.')}} </a>
<a class="caption-link" href="{{ pathto('site/forusers/visualchangelog%s/index'|format(shortver)) }}" > {{_('changelog.')}} </a>
</p>
</div>
</div>
Expand Down

0 comments on commit 41d05c5

Please sign in to comment.