Skip to content

Commit a6186a0

Browse files
Prepare for v1.6.5 release
2 parents 0348c03 + ff134ae commit a6186a0

File tree

7 files changed

+79
-53
lines changed

7 files changed

+79
-53
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A [Cataclysm: Dark Days Ahead](https://cataclysmdda.org/) launcher with addition
1414
![GitHub release (latest by date)](https://img.shields.io/github/v/release/DazedNConfused-/CDDA-Game-Launcher)
1515
![GitHub all releases](https://img.shields.io/github/downloads/DazedNConfused-/CDDA-Game-Launcher/total)
1616
[![GitHub forks](https://img.shields.io/github/forks/DazedNConfused-/CDDA-Game-Launcher)](https://github.com/DazedNConfused-/CDDA-Game-Launcher/network)
17+
[![REUSE status](https://api.reuse.software/badge/github.com/DazedNConfused-/CDDA-Game-Launcher)](https://api.reuse.software/info/github.com/DazedNConfused-/CDDA-Game-Launcher)
1718

1819
[Download here](https://github.com/DazedNConfused-/CDDA-Game-Launcher/releases).
1920

cddagl/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.6.4
1+
1.6.5

cddagl/constants.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
CDDA_RELEASE_BY_TAG = lambda tag: f'/repos/CleverRaven/Cataclysm-DDA/releases/tags/{tag}'
2222
CDDAGL_LATEST_RELEASE = '/repos/DazedNConfused-/CDDA-Game-Launcher/releases/latest'
2323

24+
CHANGELOG_URL = 'https://api.github.com/search/issues?q=repo%3Acleverraven/Cataclysm-DDA+is%3Apr+is%3Amerged&per_page='
25+
2426
NEW_ISSUE_URL = 'https://github.com/DazedNConfused-/CDDA-Game-Launcher/issues/new'
2527

2628
CDDA_ISSUE_URL_ROOT = 'https://github.com/CleverRaven/Cataclysm-DDA/issues/'
@@ -40,29 +42,6 @@
4042
TEMP_PREFIX = 'cddagl'
4143

4244
BASE_ASSETS = {
43-
'Tiles': {
44-
'x64': {
45-
'Platform': 'Windows_x64',
46-
'Graphics': 'Tiles'
47-
},
48-
'x86': {
49-
'Platform': 'Windows',
50-
'Graphics': 'Tiles'
51-
}
52-
},
53-
'Console': {
54-
'x64': {
55-
'Platform': 'Windows_x64',
56-
'Graphics': 'Curses'
57-
},
58-
'x86': {
59-
'Platform': 'Windows',
60-
'Graphics': 'Curses'
61-
},
62-
}
63-
}
64-
65-
NEW_BASE_ASSETS = {
6645
'Tiles': {
6746
'x64': {
6847
'Platform': 'x64',

cddagl/resources/launcher.ico

-97.3 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
SPDX-FileCopyrightText: 2021 Paul Davey aka Mattahan <https://mattahan.deviantart.com/>
1+
SPDX-FileCopyrightText: 2022 Aunt Su <https://github.com/I-am-Erk/CDDA-Tilesets/>
22

33
SPDX-License-Identifier: CC-BY-NC-SA-2.5
44

5-
SPDX-FileComment: This file was converted to .ico from "thepngs/Difficultware/Newer Looking, But Older Rocket.png" extracted from "Buuf", which cab be downloaded here: <https://www.deviantart.com/mattahan/art/Buuf-37966044>
5+
SPDX-FileComment: Launcher Icon By Aunt Su, edited by acepleiades from the CDDA tileset repo <https://github.com/I-am-Erk/CDDA-Tilesets>

cddagl/ui/views/main.py

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
import tempfile
1616
import zipfile
1717
import random
18+
import requests
1819

1920
from collections import deque
2021
from datetime import datetime, timedelta
21-
from io import BytesIO, TextIOWrapper
22+
from io import BytesIO, StringIO, TextIOWrapper
2223
from os import scandir
2324
from pathlib import Path
2425
from urllib.parse import urljoin
@@ -1476,19 +1477,16 @@ def find_build_finished(self):
14761477
asset_platform = self.base_asset['Platform']
14771478
asset_graphics = self.base_asset['Graphics']
14781479

1479-
target_regex = re.compile(r'cataclysmdda-(?P<major>.+)-' +
1480-
re.escape(asset_platform) + r'-' +
1480+
target_regex = re.compile(
1481+
r'cdda-windows-' +
14811482
re.escape(asset_graphics) + r'-' +
1482-
r'b?(?P<build>\d+)\.zip'
1483+
re.escape(asset_platform) + r'-' +
1484+
r'b?(?P<build>[0-9\-]+)\.zip'
14831485
)
1484-
1485-
new_asset_platform = self.new_base_asset['Platform']
1486-
new_asset_graphics = self.new_base_asset['Graphics']
1487-
1488-
new_target_regex = re.compile(
1486+
target_regex_msvc = re.compile(
14891487
r'cdda-windows-' +
1490-
re.escape(new_asset_graphics) + r'-' +
1491-
re.escape(new_asset_platform) + r'-msvc-' +
1488+
re.escape(asset_graphics) + r'-' +
1489+
re.escape(asset_platform) + r'-msvc-' +
14921490
r'b?(?P<build>[0-9\-]+)\.zip'
14931491
)
14941492

@@ -1508,7 +1506,7 @@ def find_build_finished(self):
15081506
and 'name' in x
15091507
and (
15101508
target_regex.search(x['name']) is not None or
1511-
new_target_regex.search(x['name']) is not None )
1509+
target_regex_msvc.search(x['name']) is not None )
15121510
)
15131511
asset = next(asset_iter, None)
15141512

@@ -2858,7 +2856,7 @@ def download_dl_progress(self, bytes_read, total_bytes):
28582856
self.download_last_bytes_read = bytes_read
28592857
self.download_last_read = datetime.utcnow()
28602858

2861-
def start_lb_request(self, base_asset, new_base_asset):
2859+
def start_lb_request(self, base_asset):
28622860
self.disable_controls(True)
28632861
self.refresh_warning_label.hide()
28642862
self.find_build_warning_label.hide()
@@ -2875,7 +2873,6 @@ def start_lb_request(self, base_asset, new_base_asset):
28752873

28762874
url = cons.GITHUB_REST_API_URL + cons.CDDA_RELEASES
28772875
self.base_asset = base_asset
2878-
self.new_base_asset = new_base_asset
28792876

28802877
fetching_label = QLabel()
28812878
fetching_label.setText(_('Fetching: {url}').format(url=url))
@@ -3036,19 +3033,17 @@ def lb_http_finished(self):
30363033
asset_platform = self.base_asset['Platform']
30373034
asset_graphics = self.base_asset['Graphics']
30383035

3039-
target_regex = re.compile(r'cataclysmdda-(?P<major>.+)-' +
3040-
re.escape(asset_platform) + r'-' +
3036+
target_regex = re.compile(
3037+
r'cdda-windows-' +
30413038
re.escape(asset_graphics) + r'-' +
3042-
r'b?(?P<build>\d+)\.zip'
3039+
re.escape(asset_platform) + r'-' +
3040+
r'b?(?P<build>[0-9\-]+)\.zip'
30433041
)
3044-
3045-
new_asset_platform = self.new_base_asset['Platform']
3046-
new_asset_graphics = self.new_base_asset['Graphics']
30473042

3048-
new_target_regex = re.compile(
3043+
target_regex_msvc = re.compile(
30493044
r'cdda-windows-' +
3050-
re.escape(new_asset_graphics) + r'-' +
3051-
re.escape(new_asset_platform) + r'-msvc-' +
3045+
re.escape(asset_graphics) + r'-' +
3046+
re.escape(asset_platform) + r'-msvc-' +
30523047
r'b?(?P<build>[0-9\-]+)\.zip'
30533048
)
30543049

@@ -3068,7 +3063,7 @@ def lb_http_finished(self):
30683063
and 'name' in x
30693064
and (
30703065
target_regex.search(x['name']) is not None or
3071-
new_target_regex.search(x['name']) is not None)
3066+
target_regex_msvc.search(x['name']) is not None)
30723067
)
30733068
asset = next(asset_iter, None)
30743069

@@ -3235,13 +3230,63 @@ def refresh_builds(self):
32353230

32363231
elif selected_branch is self.experimental_radio_button:
32373232
release_asset = cons.BASE_ASSETS['Tiles'][selected_platform]
3238-
release_new_asset = cons.NEW_BASE_ASSETS['Tiles'][selected_platform]
32393233

3240-
self.start_lb_request(release_asset, release_new_asset)
3234+
self.start_lb_request( release_asset )
32413235
self.refresh_changelog()
32423236

32433237
def refresh_changelog(self):
3244-
self.changelog_content.setHtml(_('<h3>Changelog is not available for experimental</h3>'))
3238+
### "((?<![\w#])(?=[\w#])|(?<=[\w#])(?![\w#]))" is like a \b
3239+
### that accepts "#" as word char too.
3240+
### regex used to match issues / PR IDs like "#43151"
3241+
id_regex = re.compile(r'((?<![\w#])(?=[\w#])|(?<=[\w#])(?![\w#]))'
3242+
r'#(?P<id>\d+)\b')
3243+
3244+
### Get the last 100 PR
3245+
url = cons.CHANGELOG_URL + '100'
3246+
3247+
changelog_data = requests.get(url).json()
3248+
changelog_html = StringIO()
3249+
3250+
date = str()
3251+
3252+
for entry in changelog_data["items"]:
3253+
if entry["state"] == "open":
3254+
continue
3255+
3256+
if date != entry['closed_at'][0:10]:
3257+
date = entry['closed_at'][0:10]
3258+
changelog_html.write('</ul>')
3259+
changelog_html.write(
3260+
'<h3>{0}</h3>'
3261+
.format(date)
3262+
)
3263+
changelog_html.write('<ul>')
3264+
changelog_html.write(
3265+
'<h4>{0}</h4>'
3266+
.format(entry['title'])
3267+
)
3268+
changelog_html.write('<ul>')
3269+
body = entry['body'].split('####')
3270+
if len(body)>2:
3271+
if body[0] == '':
3272+
msg = body[2]
3273+
else:
3274+
msg = body[3]
3275+
msg=msg[18:]
3276+
else:
3277+
msg = entry['title']
3278+
commitid = entry['node_id']
3279+
link_repl = rf'<a href="{cons.CDDA_ISSUE_URL_ROOT}\g<id>">#\g<id></a>'
3280+
msg = id_regex.sub(link_repl, msg)
3281+
commit_name = entry['number']
3282+
if commitid:
3283+
commit_url = entry['html_url']
3284+
changelog_html.write(f'<li>{msg} [<a href="{commit_url}">{commit_name}</a>]</li>')
3285+
else:
3286+
changelog_html.write(f'<li>{msg}</li>')
3287+
changelog_html.write('</ul>')
3288+
3289+
self.changelog_content.setHtml(changelog_html.getvalue())
32453290

32463291
def branch_clicked(self, button):
32473292
if button is self.stable_radio_button:

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ pypiwin32
1616
pywin32
1717
httpx
1818
pylzma
19+
requests

0 commit comments

Comments
 (0)