Consistent version management
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
from src.utils import version
|
||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
"requests==2.26.0",
|
"requests==2.26.0",
|
||||||
@@ -11,7 +11,7 @@ install_requires = [
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='aostats',
|
name='aostats',
|
||||||
version='1.0.0',
|
version=version.get_version(),
|
||||||
packages=find_packages('.', include=('src*')),
|
packages=find_packages('.', include=('src*')),
|
||||||
package_data={'': ['**/*.png']},
|
package_data={'': ['**/*.png']},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
|||||||
+2
-19
@@ -17,7 +17,6 @@ from ..utils.config import config
|
|||||||
from .modules.main import MainWidget
|
from .modules.main import MainWidget
|
||||||
from .styling import style
|
from .styling import style
|
||||||
from ..utils.version import current_version as get_current_version
|
from ..utils.version import current_version as get_current_version
|
||||||
from ..utils.version import latest_url
|
|
||||||
from ..utils.version import latest_version as get_latest_version
|
from ..utils.version import latest_version as get_latest_version
|
||||||
from ..utils.assets import path
|
from ..utils.assets import path
|
||||||
from ..utils.assets import scripts
|
from ..utils.assets import scripts
|
||||||
@@ -30,18 +29,6 @@ def fix_npcap():
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
def get_modt(always_on_top):
|
|
||||||
motd_url = 'https://mazurwiktor.github.io/aostats/motd'
|
|
||||||
msg = QMessageBox()
|
|
||||||
msg.setWindowIcon(QtGui.QIcon(path('albion-stats-icon.png')))
|
|
||||||
msg.setObjectName("Motd")
|
|
||||||
msg.setWindowTitle("Message of the day")
|
|
||||||
msg.setInformativeText(str(requests.get(motd_url).text))
|
|
||||||
msg.setStandardButtons(QMessageBox.Ok)
|
|
||||||
|
|
||||||
return msg
|
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
initialization_result = initialize()
|
initialization_result = initialize()
|
||||||
|
|
||||||
@@ -66,16 +53,12 @@ def run():
|
|||||||
widget.setWindowTitle('Albion Online Stats')
|
widget.setWindowTitle('Albion Online Stats')
|
||||||
widget.setWindowIcon(QtGui.QIcon(path('albion-stats-icon.png')))
|
widget.setWindowIcon(QtGui.QIcon(path('albion-stats-icon.png')))
|
||||||
|
|
||||||
modt = get_modt(['always_on_top'])
|
|
||||||
|
|
||||||
if window_config['always_on_top']:
|
if window_config['always_on_top']:
|
||||||
widget.setWindowFlag(Qt.WindowStaysOnTopHint)
|
widget.setWindowFlag(Qt.WindowStaysOnTopHint)
|
||||||
modt.setWindowFlag(Qt.WindowStaysOnTopHint)
|
|
||||||
if window_config['frameless']:
|
if window_config['frameless']:
|
||||||
widget.setWindowFlag(Qt.FramelessWindowHint)
|
widget.setWindowFlag(Qt.FramelessWindowHint)
|
||||||
|
|
||||||
widget.show()
|
widget.show()
|
||||||
modt.show()
|
|
||||||
|
|
||||||
current_version, latest_version = (
|
current_version, latest_version = (
|
||||||
get_current_version(), get_latest_version())
|
get_current_version(), get_latest_version())
|
||||||
@@ -85,8 +68,8 @@ def run():
|
|||||||
msg.setIcon(QMessageBox.Warning)
|
msg.setIcon(QMessageBox.Warning)
|
||||||
msg.setWindowTitle("Update available!")
|
msg.setWindowTitle("Update available!")
|
||||||
msg.setText("Another version of app is avaliable.")
|
msg.setText("Another version of app is avaliable.")
|
||||||
msg.setInformativeText("You are using app in version {}, new version {} available <a href='{}'>here</a>".format(
|
msg.setInformativeText("You are using app in version {}, latest version is {}".format(
|
||||||
current_version, latest_version, latest_url))
|
current_version, latest_version))
|
||||||
msg.setStandardButtons(QMessageBox.Ok)
|
msg.setStandardButtons(QMessageBox.Ok)
|
||||||
msg.show()
|
msg.show()
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from PySide2.QtWidgets import QMessageBox # type: ignore
|
from PySide2.QtWidgets import QMessageBox # noqa type: ignore
|
||||||
|
|
||||||
|
from ...utils.version import get_version
|
||||||
|
|
||||||
text = """
|
text = """
|
||||||
This software is free to use and delivered to you with a lot on fun :)
|
This software is free to use and delivered to you with a lot on fun :)
|
||||||
@@ -18,7 +19,7 @@ class About(QMessageBox):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
QMessageBox.__init__(self)
|
QMessageBox.__init__(self)
|
||||||
self.setIcon(QMessageBox.Information)
|
self.setIcon(QMessageBox.Information)
|
||||||
self.setWindowTitle("Albion online stats")
|
self.setWindowTitle(f"Albion online stats {get_version()}")
|
||||||
self.setText(text)
|
self.setText(text)
|
||||||
self.setInformativeText('<a href="{}"> Report Bug/Feature request </a> | <a href="{}"> Contribute </a> | <a href="{}"> Download </a> | <a href="{}"> Donate </a>'.format(
|
self.setInformativeText('<a href="{}"> Report Bug/Feature request </a> | <a href="{}"> Contribute </a> | <a href="{}"> Download </a> | <a href="{}"> Donate </a>'.format(
|
||||||
"https://github.com/mazurwiktor/albion-online-stats/issues/new/choose",
|
"https://github.com/mazurwiktor/albion-online-stats/issues/new/choose",
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
_version = "0.11.12"
|
_version = "1.0.0"
|
||||||
|
|
||||||
latest_url = "https://github.com/mazurwiktor/albion-online-stats/releases/latest"
|
latest_url = "https://github.com/mazurwiktor/albion-online-stats/releases/latest"
|
||||||
|
|
||||||
|
|
||||||
|
def get_version():
|
||||||
|
return _version
|
||||||
|
|
||||||
|
|
||||||
def latest_version():
|
def latest_version():
|
||||||
req = requests.get(latest_url)
|
req = requests.get(latest_url)
|
||||||
if req.status_code == 200:
|
if req.status_code == 200:
|
||||||
|
|||||||
Reference in New Issue
Block a user