FileLoadThread¶
-
class
specviz.core.threads.FileLoadThread(parent=None)[source]¶ Bases:
PyQt5.QtCore.QThreadAsynchronously read in a file
Parameters: -
file_name¶ str – Name of the file to read.
-
file_filter¶ str – Type of file to read. If
Auto, try all known formats.
-
Signals¶
-
-------
-
status(message, timeout)¶ - State of the thread
- message: The status message timeout: Time (msec) to display message
-
result(Spectrum1DRef)¶ The file’s data
Attributes Summary
resultstatusMethods Summary
__call__(file_name, file_filter)Initialize the thread read_file(file_name, file_filter)Convenience method that directly reads a spectrum from a file. run()Start thread to read the file. Attributes Documentation
-
result
-
status
Methods Documentation
-
read_file(file_name, file_filter)[source]¶ Convenience method that directly reads a spectrum from a file.
Parameters: Returns: data – The file’s data or None if no known formats are found.
Return type: Spectrum1DRef
Notes
This exists mostly to facilitate development workflow. In time it could be augmented to support fancier features such as wildcards, file lists, mixed file types, and the like. Note that the filter string is hard coded here; its details might depend on the intrincacies of the registries, loaders, and data classes. In other words, this is brittle code.
-