Skip to content

Commit

Permalink
Prepare for v1.6.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
DazedNConfused- authored Apr 12, 2022
2 parents 0348c03 + ff134ae commit a6186a0
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 53 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ A [Cataclysm: Dark Days Ahead](https://cataclysmdda.org/) launcher with addition
![GitHub release (latest by date)](https://img.shields.io/github/v/release/DazedNConfused-/CDDA-Game-Launcher)
![GitHub all releases](https://img.shields.io/github/downloads/DazedNConfused-/CDDA-Game-Launcher/total)
[![GitHub forks](https://img.shields.io/github/forks/DazedNConfused-/CDDA-Game-Launcher)](https://github.com/DazedNConfused-/CDDA-Game-Launcher/network)
[![REUSE status](https://api.reuse.software/badge/github.com/DazedNConfused-/CDDA-Game-Launcher)](https://api.reuse.software/info/github.com/DazedNConfused-/CDDA-Game-Launcher)

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

Expand Down
2 changes: 1 addition & 1 deletion cddagl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.4
1.6.5
25 changes: 2 additions & 23 deletions cddagl/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
CDDA_RELEASE_BY_TAG = lambda tag: f'/repos/CleverRaven/Cataclysm-DDA/releases/tags/{tag}'
CDDAGL_LATEST_RELEASE = '/repos/DazedNConfused-/CDDA-Game-Launcher/releases/latest'

CHANGELOG_URL = 'https://api.github.com/search/issues?q=repo%3Acleverraven/Cataclysm-DDA+is%3Apr+is%3Amerged&per_page='

NEW_ISSUE_URL = 'https://github.com/DazedNConfused-/CDDA-Game-Launcher/issues/new'

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

BASE_ASSETS = {
'Tiles': {
'x64': {
'Platform': 'Windows_x64',
'Graphics': 'Tiles'
},
'x86': {
'Platform': 'Windows',
'Graphics': 'Tiles'
}
},
'Console': {
'x64': {
'Platform': 'Windows_x64',
'Graphics': 'Curses'
},
'x86': {
'Platform': 'Windows',
'Graphics': 'Curses'
},
}
}

NEW_BASE_ASSETS = {
'Tiles': {
'x64': {
'Platform': 'x64',
Expand Down
Binary file modified cddagl/resources/launcher.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions cddagl/resources/launcher.ico.license
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SPDX-FileCopyrightText: 2021 Paul Davey aka Mattahan <https://mattahan.deviantart.com/>
SPDX-FileCopyrightText: 2022 Aunt Su <https://github.com/I-am-Erk/CDDA-Tilesets/>

SPDX-License-Identifier: CC-BY-NC-SA-2.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>
SPDX-FileComment: Launcher Icon By Aunt Su, edited by acepleiades from the CDDA tileset repo <https://github.com/I-am-Erk/CDDA-Tilesets>
99 changes: 72 additions & 27 deletions cddagl/ui/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
import tempfile
import zipfile
import random
import requests

from collections import deque
from datetime import datetime, timedelta
from io import BytesIO, TextIOWrapper
from io import BytesIO, StringIO, TextIOWrapper
from os import scandir
from pathlib import Path
from urllib.parse import urljoin
Expand Down Expand Up @@ -1476,19 +1477,16 @@ def find_build_finished(self):
asset_platform = self.base_asset['Platform']
asset_graphics = self.base_asset['Graphics']

target_regex = re.compile(r'cataclysmdda-(?P<major>.+)-' +
re.escape(asset_platform) + r'-' +
target_regex = re.compile(
r'cdda-windows-' +
re.escape(asset_graphics) + r'-' +
r'b?(?P<build>\d+)\.zip'
re.escape(asset_platform) + r'-' +
r'b?(?P<build>[0-9\-]+)\.zip'
)

new_asset_platform = self.new_base_asset['Platform']
new_asset_graphics = self.new_base_asset['Graphics']

new_target_regex = re.compile(
target_regex_msvc = re.compile(
r'cdda-windows-' +
re.escape(new_asset_graphics) + r'-' +
re.escape(new_asset_platform) + r'-msvc-' +
re.escape(asset_graphics) + r'-' +
re.escape(asset_platform) + r'-msvc-' +
r'b?(?P<build>[0-9\-]+)\.zip'
)

Expand All @@ -1508,7 +1506,7 @@ def find_build_finished(self):
and 'name' in x
and (
target_regex.search(x['name']) is not None or
new_target_regex.search(x['name']) is not None )
target_regex_msvc.search(x['name']) is not None )
)
asset = next(asset_iter, None)

Expand Down Expand Up @@ -2858,7 +2856,7 @@ def download_dl_progress(self, bytes_read, total_bytes):
self.download_last_bytes_read = bytes_read
self.download_last_read = datetime.utcnow()

def start_lb_request(self, base_asset, new_base_asset):
def start_lb_request(self, base_asset):
self.disable_controls(True)
self.refresh_warning_label.hide()
self.find_build_warning_label.hide()
Expand All @@ -2875,7 +2873,6 @@ def start_lb_request(self, base_asset, new_base_asset):

url = cons.GITHUB_REST_API_URL + cons.CDDA_RELEASES
self.base_asset = base_asset
self.new_base_asset = new_base_asset

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

target_regex = re.compile(r'cataclysmdda-(?P<major>.+)-' +
re.escape(asset_platform) + r'-' +
target_regex = re.compile(
r'cdda-windows-' +
re.escape(asset_graphics) + r'-' +
r'b?(?P<build>\d+)\.zip'
re.escape(asset_platform) + r'-' +
r'b?(?P<build>[0-9\-]+)\.zip'
)

new_asset_platform = self.new_base_asset['Platform']
new_asset_graphics = self.new_base_asset['Graphics']

new_target_regex = re.compile(
target_regex_msvc = re.compile(
r'cdda-windows-' +
re.escape(new_asset_graphics) + r'-' +
re.escape(new_asset_platform) + r'-msvc-' +
re.escape(asset_graphics) + r'-' +
re.escape(asset_platform) + r'-msvc-' +
r'b?(?P<build>[0-9\-]+)\.zip'
)

Expand All @@ -3068,7 +3063,7 @@ def lb_http_finished(self):
and 'name' in x
and (
target_regex.search(x['name']) is not None or
new_target_regex.search(x['name']) is not None)
target_regex_msvc.search(x['name']) is not None)
)
asset = next(asset_iter, None)

Expand Down Expand Up @@ -3235,13 +3230,63 @@ def refresh_builds(self):

elif selected_branch is self.experimental_radio_button:
release_asset = cons.BASE_ASSETS['Tiles'][selected_platform]
release_new_asset = cons.NEW_BASE_ASSETS['Tiles'][selected_platform]

self.start_lb_request(release_asset, release_new_asset)
self.start_lb_request( release_asset )
self.refresh_changelog()

def refresh_changelog(self):
self.changelog_content.setHtml(_('<h3>Changelog is not available for experimental</h3>'))
### "((?<![\w#])(?=[\w#])|(?<=[\w#])(?![\w#]))" is like a \b
### that accepts "#" as word char too.
### regex used to match issues / PR IDs like "#43151"
id_regex = re.compile(r'((?<![\w#])(?=[\w#])|(?<=[\w#])(?![\w#]))'
r'#(?P<id>\d+)\b')

### Get the last 100 PR
url = cons.CHANGELOG_URL + '100'

changelog_data = requests.get(url).json()
changelog_html = StringIO()

date = str()

for entry in changelog_data["items"]:
if entry["state"] == "open":
continue

if date != entry['closed_at'][0:10]:
date = entry['closed_at'][0:10]
changelog_html.write('</ul>')
changelog_html.write(
'<h3>{0}</h3>'
.format(date)
)
changelog_html.write('<ul>')
changelog_html.write(
'<h4>{0}</h4>'
.format(entry['title'])
)
changelog_html.write('<ul>')
body = entry['body'].split('####')
if len(body)>2:
if body[0] == '':
msg = body[2]
else:
msg = body[3]
msg=msg[18:]
else:
msg = entry['title']
commitid = entry['node_id']
link_repl = rf'<a href="{cons.CDDA_ISSUE_URL_ROOT}\g<id>">#\g<id></a>'
msg = id_regex.sub(link_repl, msg)
commit_name = entry['number']
if commitid:
commit_url = entry['html_url']
changelog_html.write(f'<li>{msg} [<a href="{commit_url}">{commit_name}</a>]</li>')
else:
changelog_html.write(f'<li>{msg}</li>')
changelog_html.write('</ul>')

self.changelog_content.setHtml(changelog_html.getvalue())

def branch_clicked(self, button):
if button is self.stable_radio_button:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ pypiwin32
pywin32
httpx
pylzma
requests

0 comments on commit a6186a0

Please sign in to comment.