Skip to content

Commit

Permalink
gui:
Browse files Browse the repository at this point in the history
 - fixing about menu
 - fixing splash screen
  • Loading branch information
SteveDoyle2 committed Nov 23, 2024
1 parent c320d80 commit 6878635
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 305 deletions.
39 changes: 31 additions & 8 deletions dev/how_to_build_gui.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
Packages
--------
>>> pip install pyqt5 vtk imageio py-splash

Last Built on:
- Python 3.11.9, 2024/11/23 (get the dev version)

Windows
-------
1. Use 32-bit or 64-bit Python 3.7
1. Use 64-bit Python 3.10+
2. Verify the gui works by typing:
>>> pyNastranGUI
3. Download pyInstaller -> http://www.pyinstaller.org/
- pyInstaller 3.1 (https://github.com/pyinstaller/pyinstaller/releases/download/v3.1/PyInstaller-3.1.zip)
3. Download pyInstaller -> https://github.com/pyinstaller/pyinstaller
- Get the dev version from github
4. Extract pyInstaller
5. Go into the pyInstaller directory and run setup.py
6. In pyInstaller/building/toc_conversion.py; line 135, change:
OLD : os.makedirs(workpath)
NEW : if not os.path.exists(workpath):
os.makedirs(workpath)
7. Go into pyNastran/dev and run:
6. DEPRECATED: In pyInstaller/building/toc_conversion.py; line 135, change:
OLD: os.makedirs(workpath)
NEW: if not os.path.exists(workpath):
os.makedirs(workpath)
7. In pyInstaller/archive/writers.py; line 138, skip the __pycache__ directory:
OLD:
# Write entries' data and collect TOC entries
toc = []
for entry in entries:
toc_entry = self._write_entry(fp, entry)
toc.append(toc_entry)
NEW:
# Write entries' data and collect TOC entries
toc = []
for entry in entries:
dest_name, src_name, compress, typecode = entry
if '__pycache__' in dest_name:
continue
toc_entry = self._write_entry(fp, entry)
toc.append(toc_entry)
8. Go into pyNastran/dev and run:
>>> pyinstaller pyNastranGUI.spec


Expand Down
2 changes: 1 addition & 1 deletion dev/pyNastranGUI.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IS_RELEASE = True
USE_TODAY = True
IS_ONEDIR = False # True=onedir; False=onefile

MAKE_SPLASH = False # requires tk
MAKE_SPLASH = True # requires tk
BUILD_EXE = True
BUILD_COLLECT = False

Expand Down

This file was deleted.

158 changes: 0 additions & 158 deletions pyNastran/bdf/cards/aero/examples/flutter/case1/ha145e.test_bdf.inp

This file was deleted.

13 changes: 11 additions & 2 deletions pyNastran/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,17 @@ def __init__(self, inputs, **kwds):
self.setup_controls()
self.setup_post(inputs)

if is_pynastrangui_exe and '_PYIBoot_SPLASH' in os.environ and importlib.util.find_spec("pyi_splash"):
import pyi_splash
if 0: # pragma: no cover
print(f'is_pynastrangui_exe = {is_pynastrangui_exe}')
if is_pynastrangui_exe:
print(f'os.environ = {os.environ}')
print('_PYIBoot_SPLASH', '_PYIBoot_SPLASH' in os.environ)
if '_PYIBoot_SPLASH' in os.environ:
is_pysplash = importlib.util.find_spec("pyi_splash")
print(f'is_pysplash', is_pysplash)

if is_pynastrangui_exe: # and '_PYIBoot_SPLASH' in os.environ and importlib.util.find_spec("pyi_splash"):
import pyi_splash # pip install py-splash
# Update the text on the splash screen
pyi_splash.update_text("PyInstaller is a great software!")
#pyi_splash.update_text("Second time's a charm!")
Expand Down
13 changes: 11 additions & 2 deletions pyNastran/gui/menus/about/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,21 @@ def get_packages() -> dict[str, str]:
if 'pyside' in qt_name.lower():
del packages['QScintilla2']

for name in ['setuptools', 'matplotlib', 'pandas', 'h5py', 'tables', 'imageio', 'PIL', 'pygments']:
pkgs = [
'setuptools', 'matplotlib', 'pandas', 'h5py', 'tables',
'imageio', 'PIL', 'pygments']
for name in pkgs:
try:
module = importlib.import_module(name, package=None)
except ImportError:
continue
packages[name] = module.__version__

try:
pkg_version = module.__version__
except AttributeError:
continue
packages[name] = pkg_version

return packages

def get_version() -> dict[str, str]:
Expand Down

0 comments on commit 6878635

Please sign in to comment.