ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
scripts.Enlighten.EnlightenApplication Class Reference

This class encapsulates processing of command-line arguments, instantiates a Controller then passes control to the Qt framework. More...

Public Member Functions

 __init__ (self, testing=False)
 
 chdir (self, script_path)
 ENLIGHTEN loads various settings from its own enlighten/assets/ example_code distribution, which it accesses through relative paths, and it can't find those if run from another directory.
 
 closeEvent (self)
 Catch the exit signal from the control application, and call QApplication Quit.
 
 create_parser (self)
 Defines the command-line arguments and their defaults.
 
 hide_console (self)
 This isn't needed on Win10 (where pyinstaller's –hide-console hide-early works, though not hide-late), but apparently is on Win11 (where hide-early doesn't work; not sure about hide-late).
 
 parse_args (self, argv)
 Parse command-line arguments.
 
 run (self)
 

Public Attributes

 app = QtWidgets.QApplication()
 
 args = None
 
 closeEvent
 
 controller = None
 
int exit_code = 0
 
 form = BasicWindow(title="ENLIGHTEN™ %s" % common.VERSION)
 
 main_logger
 
 parser = self.create_parser()
 
 splash = QSplashScreen()
 
 testing = testing
 

Detailed Description

This class encapsulates processing of command-line arguments, instantiates a Controller then passes control to the Qt framework.

Constructor & Destructor Documentation

◆ __init__()

scripts.Enlighten.EnlightenApplication.__init__ ( self,
testing = False )

Member Function Documentation

◆ chdir()

scripts.Enlighten.EnlightenApplication.chdir ( self,
script_path )

ENLIGHTEN loads various settings from its own enlighten/assets/ example_code distribution, which it accesses through relative paths, and it can't find those if run from another directory.

◆ closeEvent()

scripts.Enlighten.EnlightenApplication.closeEvent ( self)

Catch the exit signal from the control application, and call QApplication Quit.

◆ create_parser()

scripts.Enlighten.EnlightenApplication.create_parser ( self)

Defines the command-line arguments and their defaults.

◆ hide_console()

scripts.Enlighten.EnlightenApplication.hide_console ( self)

This isn't needed on Win10 (where pyinstaller's –hide-console hide-early works, though not hide-late), but apparently is on Win11 (where hide-early doesn't work; not sure about hide-late).

Calling for coverage on Win11.

See also
https://github.com/pyinstaller/pyinstaller/issues/7729#issuecomment-1605503018
https://github.com/pyinstaller/pyinstaller/pull/7735

◆ parse_args()

scripts.Enlighten.EnlightenApplication.parse_args ( self,
argv )

Parse command-line arguments.

◆ run()

scripts.Enlighten.EnlightenApplication.run ( self)

Member Data Documentation

◆ app

scripts.Enlighten.EnlightenApplication.app = QtWidgets.QApplication()

◆ args

scripts.Enlighten.EnlightenApplication.args = None

◆ closeEvent

scripts.Enlighten.EnlightenApplication.closeEvent
Initial value:
= Controller(
app = self.app,
log_level = self.args.log_level,
log_queue = self.main_logger.log_queue,
max_memory_growth = self.args.max_memory_growth,
max_thumbnails = self.args.max_thumbnails,
run_sec = self.args.run_sec,
serial_number = self.args.serial_number,
stylesheet_path = self.args.stylesheet_path,
set_all_dfu = self.args.set_all_dfu,
form = self.form,
splash = self.splash,
window_state = self.args.window_state,
start_batch = self.args.start_batch,
password = self.args.password,
plugin = self.args.plugin)

◆ controller

scripts.Enlighten.EnlightenApplication.controller = None

◆ exit_code

scripts.Enlighten.EnlightenApplication.exit_code = 0

◆ form

scripts.Enlighten.EnlightenApplication.form = BasicWindow(title="ENLIGHTEN™ %s" % common.VERSION)

◆ main_logger

scripts.Enlighten.EnlightenApplication.main_logger
Initial value:
= applog.MainLogger(
"DEBUG", # we always start in debug logging to catch startup issues
logfile=self.args.logfile,
timeout_sec=5,
enable_stdout=not self.testing,
append_arg=str(self.args.log_append)
)

◆ parser

scripts.Enlighten.EnlightenApplication.parser = self.create_parser()

◆ splash

scripts.Enlighten.EnlightenApplication.splash = QSplashScreen()

◆ testing

scripts.Enlighten.EnlightenApplication.testing = testing

The documentation for this class was generated from the following file: