|
ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
|
Functions | |
| _json_object_hook (d) | |
| add_combobox_item (combobox, name) | |
| apply_min_max (widget) | |
| clean_json (s) | |
| Assuming JSON has been rendered with indentation, leave the dicts indented but flatten arrays to single lines. | |
| clean_list (a) | |
| decr_spinbox (spinbox) | |
| str | determine_encoding (str pathname) |
| find_file (filename, dirs) | |
| File Helpers. | |
| force_size (widget, width, height) | |
| get_bullet () | |
| get_combobox_item_index (combobox, name) | |
| incr_spinbox (spinbox) | |
| is_today (mon, day, year=None) | |
| Date/Time Helpers. | |
| join_valid (delim, tokens) | |
| String Helpers. | |
| json2obj (text) | |
| JSON helpers. | |
| normalize_decimal (obj) | |
| Recurse down a potentially nested structure of dicts and lists, converting every Decimal into a float. | |
| normalize_filename (filename) | |
| Some filenames are auto-populated from the on-screen labels used on thumbnails and graph traces. | |
| normalize_history (x, hi=65535.0) | |
| Qt Helpers. | |
| pluralize (count, singular, plural) | |
| pluralize_spectra (count) | |
| This made Chris Paul happy. | |
| str | printable (str s) |
| bang (!) through tilde (~) | |
| python_version () | |
| remove_combobox_item (combobox, name) | |
| safe_mkdirp (directory) | |
| create a directory tree, optionally requiring user expansion (~), without throwing exceptions | |
| set_checkbox_quietly (cb, flag) | |
| set_enabled (w, flag, tooltip=None) | |
| Enable or disable a QWidget, while simultaneous restoring or clearing its QToolTip. | |
| set_min_max (widget, lo, hi, value=None) | |
| set_table_row_color (table, row, color) | |
| should be e.g. | |
| sets_intersect (s1, s2, case_insensitive=False) | |
| undent (s) | |
| unwrap (s) | |
Variables | |
| log = logging.getLogger(__name__) | |
|
protected |
| enlighten.util.add_combobox_item | ( | combobox, | |
| name ) |
| enlighten.util.apply_min_max | ( | widget | ) |
| enlighten.util.clean_json | ( | s | ) |
Assuming JSON has been rendered with indentation, leave the dicts indented but flatten arrays to single lines.
Also, normalize NaN.
| enlighten.util.clean_list | ( | a | ) |
| enlighten.util.decr_spinbox | ( | spinbox | ) |
| str enlighten.util.determine_encoding | ( | str | pathname | ) |
| enlighten.util.find_file | ( | filename, | |
| dirs ) |
File Helpers.
| enlighten.util.force_size | ( | widget, | |
| width, | |||
| height ) |
| enlighten.util.get_bullet | ( | ) |
| enlighten.util.get_combobox_item_index | ( | combobox, | |
| name ) |
| enlighten.util.incr_spinbox | ( | spinbox | ) |
| enlighten.util.is_today | ( | mon, | |
| day, | |||
| year = None ) |
Date/Time Helpers.
| enlighten.util.join_valid | ( | delim, | |
| tokens ) |
String Helpers.
join list, tossing any nulls / empty strings
| enlighten.util.json2obj | ( | text | ) |
JSON helpers.
This didn't seem to work, but I'm not taking time to troubleshoot it now. Explore later as a way to minimize the number of dicts vs objects passed externally.
| enlighten.util.normalize_decimal | ( | obj | ) |
Recurse down a potentially nested structure of dicts and lists, converting every Decimal into a float.
Used to normalize results from AWS DynamoDB. (Is there a way to make boto default to this?)
| enlighten.util.normalize_filename | ( | filename | ) |
Some filenames are auto-populated from the on-screen labels used on thumbnails and graph traces.
However, those labels may include characters that aren't valid (or wise) in filenames, like colon, slash, and backslash, so normalize those out.
| enlighten.util.normalize_history | ( | x, | |
| hi = 65535.0 ) |
Qt Helpers.
| enlighten.util.pluralize | ( | count, | |
| singular, | |||
| plural ) |
| enlighten.util.pluralize_spectra | ( | count | ) |
This made Chris Paul happy.
| str enlighten.util.printable | ( | str | s | ) |
bang (!) through tilde (~)
| enlighten.util.python_version | ( | ) |
| enlighten.util.remove_combobox_item | ( | combobox, | |
| name ) |
| enlighten.util.safe_mkdirp | ( | directory | ) |
create a directory tree, optionally requiring user expansion (~), without throwing exceptions
| enlighten.util.set_checkbox_quietly | ( | cb, | |
| flag ) |
| enlighten.util.set_enabled | ( | w, | |
| flag, | |||
| tooltip = None ) |
Enable or disable a QWidget, while simultaneous restoring or clearing its QToolTip.
Normally you can't disable or hide a tooltip. In this case, I would like to change the tooltip behavior for disabled widgets.
| enlighten.util.set_min_max | ( | widget, | |
| lo, | |||
| hi, | |||
| value = None ) |
| enlighten.util.set_table_row_color | ( | table, | |
| row, | |||
| color ) |
| enlighten.util.sets_intersect | ( | s1, | |
| s2, | |||
| case_insensitive = False ) |
could memoize if this ever became performance-critical
best option would be to maintain sets in lowercase
| enlighten.util.undent | ( | s | ) |
| enlighten.util.unwrap | ( | s | ) |
| enlighten.util.log = logging.getLogger(__name__) |