mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
Adding release date to changelog window
This commit is contained in:
parent
efaf5bbf21
commit
1bfb5da7b4
1 changed files with 11 additions and 5 deletions
|
|
@ -941,8 +941,9 @@ class ChangelogWindow(popup.PopupWindow):
|
||||||
|
|
||||||
bui.textwidget(parent=self._root_widget,
|
bui.textwidget(parent=self._root_widget,
|
||||||
position=(width * 0.49, height * 0.72), size=(0, 0),
|
position=(width * 0.49, height * 0.72), size=(0, 0),
|
||||||
h_align='center', v_align='center', text=PLUGIN_MANAGER_VERSION,
|
h_align='center', v_align='center',
|
||||||
scale=text_scale * 1.1, color=color,
|
text=PLUGIN_MANAGER_VERSION + _CACHE['changelog']['released_on'],
|
||||||
|
scale=text_scale * 0.9, color=color,
|
||||||
maxwidth=width * 0.9)
|
maxwidth=width * 0.9)
|
||||||
|
|
||||||
bui.buttonwidget(
|
bui.buttonwidget(
|
||||||
|
|
@ -954,7 +955,7 @@ class ChangelogWindow(popup.PopupWindow):
|
||||||
button_type='square',
|
button_type='square',
|
||||||
on_activate_call=lambda: bui.open_url(REPOSITORY_URL + '/blob/main/CHANGELOG.md'))
|
on_activate_call=lambda: bui.open_url(REPOSITORY_URL + '/blob/main/CHANGELOG.md'))
|
||||||
|
|
||||||
logs = _CACHE['changelog'].split('\n')
|
logs = _CACHE['changelog']['info'].split('\n')
|
||||||
loop_height = height * 0.62
|
loop_height = height * 0.62
|
||||||
for log in logs:
|
for log in logs:
|
||||||
bui.textwidget(parent=self._root_widget,
|
bui.textwidget(parent=self._root_widget,
|
||||||
|
|
@ -1418,15 +1419,20 @@ class PluginManager:
|
||||||
full_changelog = await self.get_changelog()
|
full_changelog = await self.get_changelog()
|
||||||
if full_changelog[1]:
|
if full_changelog[1]:
|
||||||
pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)"
|
pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)"
|
||||||
|
released_on = full_changelog[0].split(version)[1].split('\n')[0]
|
||||||
matches = re.findall(pattern, full_changelog[0], re.DOTALL)
|
matches = re.findall(pattern, full_changelog[0], re.DOTALL)
|
||||||
if matches:
|
if matches:
|
||||||
changelog = matches[0].strip()
|
changelog = {
|
||||||
|
'released_on': released_on,
|
||||||
|
'info': matches[0].strip()
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
changelog = f"Changelog entry for version {version} not found."
|
changelog = f"Changelog entry for version {version} not found."
|
||||||
else:
|
else:
|
||||||
changelog = full_changelog[0]
|
changelog = full_changelog[0]
|
||||||
except urllib.error.URLError:
|
except urllib.error.URLError:
|
||||||
changelog = 'Could not get ChangeLog due to Internet Issues.'
|
changelog = {'released_on': '(Not Provided)',
|
||||||
|
'info': 'Could not get ChangeLog due to Internet Issues.'}
|
||||||
self.set_changelog_global_cache(changelog)
|
self.set_changelog_global_cache(changelog)
|
||||||
self._changelog_setup_in_progress = False
|
self._changelog_setup_in_progress = False
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue