1
1
"""Main installer window."""
2
+
2
3
import logging
3
4
from math import floor
4
5
import os
51
52
52
53
53
54
class AnsysPythonInstaller (QtWidgets .QMainWindow ):
55
+ """Main Ansys Python Manager class."""
56
+
54
57
signal_error = QtCore .Signal (str )
55
58
signal_open_pbar = QtCore .Signal (int , str )
56
59
signal_increment_pbar = QtCore .Signal ()
@@ -59,6 +62,7 @@ class AnsysPythonInstaller(QtWidgets.QMainWindow):
59
62
signal_close = QtCore .Signal ()
60
63
61
64
def __init__ (self , show = True ):
65
+ """Instantiate Ansys Python Manager main class."""
62
66
super ().__init__ ()
63
67
self .setWindowTitle ("Ansys Python Manager" )
64
68
self .setGeometry (50 , 50 , 500 , 700 ) # width should auto-update
@@ -179,11 +183,6 @@ def __init__(self, show=True):
179
183
python_version_layout .setContentsMargins (0 , 0 , 0 , 0 )
180
184
python_version .setLayout (python_version_layout )
181
185
182
- # python_version_title = QtWidgets.QLabel("Python Version")
183
- # python_version_layout.addWidget(python_version_title)
184
-
185
- # python_version_text = QtWidgets.QLabel("Select one")
186
-
187
186
self .python_version_select = QtWidgets .QComboBox ()
188
187
self .python_version_select .addItem ("Python 3.7" , "3.7.9" )
189
188
self .python_version_select .addItem ("Python 3.8" , "3.8.10" )
@@ -249,19 +248,19 @@ def _close(self):
249
248
250
249
@protected
251
250
def check_for_updates (self ):
251
+ """Check for Ansys Python Manager application updates."""
252
252
LOG .debug ("Checking for updates" )
253
253
(
254
254
ver ,
255
255
url ,
256
256
) = query_gh_latest_release ()
257
257
cur_ver = version .parse (__version__ )
258
- # if ver > cur_ver:
259
- if True :
258
+ if ver > cur_ver :
260
259
LOG .debug ("Update available." )
261
260
reply = QtWidgets .QMessageBox .question (
262
261
None ,
263
262
"Update" ,
264
- f"A new version { ver } is available . You are currently running version { cur_ver } . Do you want to update?" ,
263
+ f"The latest version available is { ver } . You are currently running version { cur_ver } . Do you want to update?" ,
265
264
QtWidgets .QMessageBox .Yes | QtWidgets .QMessageBox .No ,
266
265
QtWidgets .QMessageBox .Yes ,
267
266
)
@@ -282,12 +281,14 @@ def check_for_updates(self):
282
281
).exec_ ()
283
282
284
283
def visit_website (self ):
284
+ """Access the Ansys Python Manager documentation."""
285
285
url = QtCore .QUrl (
286
286
"https://installer.docs.pyansys.com/version/dev/installer.html"
287
287
)
288
288
QtGui .QDesktopServices .openUrl (url )
289
289
290
290
def show_about_dialog (self ):
291
+ """Display the Ansys Python Manager 'About' information."""
291
292
mbox = QtWidgets .QMessageBox .about (self , "About" , ABOUT_TEXT )
292
293
293
294
def _install_type_changed (self , * args ):
@@ -316,7 +317,6 @@ def _pbar_increment(self):
316
317
def pbar_open (self , nticks = 5 , label = "" ):
317
318
"""Open the progress bar.
318
319
319
-
320
320
Parameters
321
321
----------
322
322
nticks : int, default: 5
@@ -535,7 +535,6 @@ def _run_exe(self, filename):
535
535
536
536
def open_gui ():
537
537
"""Start the installer as a QT Application."""
538
-
539
538
import argparse
540
539
import ctypes
541
540
import msvcrt
0 commit comments