|
1 | | -#!/usr/bin/env python |
2 | 1 | from __future__ import (absolute_import, division, print_function) |
3 | 2 |
|
4 | 3 | import copy |
|
43 | 42 |
|
44 | 43 | # PyONcat |
45 | 44 | try: |
46 | | - from addie.processing.mantid.master_table.import_from_database.import_from_database_handler import \ |
47 | | - ImportFromDatabaseHandler |
| 45 | + from addie.processing.mantid.master_table.import_from_database.import_from_database_handler import ImportFromDatabaseHandler # noqa |
48 | 46 | ONCAT_ENABLED = True |
49 | 47 | except ImportError: |
50 | 48 | print('pyoncat module not found. Functionality disabled') |
|
55 | 53 | import addie.addiedriver as driver |
56 | 54 | import addie.calculate_gr.edit_sq_dialog |
57 | 55 |
|
58 | | -from addie.icons import icons_rc # necessary to see all the icons |
| 56 | +# necessary to see all the icons |
| 57 | +from addie.icons import icons_rc # noqa |
59 | 58 |
|
60 | 59 | from addie.calculate_gr.pdf_lines_manager import PDFPlotManager |
61 | 60 |
|
@@ -425,7 +424,7 @@ def help_button_clicked_autonom(self): |
425 | 424 |
|
426 | 425 | def main_tab_widget_changed(self, tab_selected): |
427 | 426 | if tab_selected == 0: |
428 | | - o_gui = Step1GuiHandler(main_window=self) |
| 427 | + Step1GuiHandler(main_window=self) |
429 | 428 | autonom_event_handler.check_step1_gui(self) |
430 | 429 | if tab_selected == 1: |
431 | 430 | _o_gui = Step2GuiHandler(main_window=self) |
@@ -471,7 +470,7 @@ def update_logbook(self, text): |
471 | 470 | if self.job_monitor_interface is None: |
472 | 471 | self.logbook_thread.stop() |
473 | 472 | else: |
474 | | - _logbook_handler = LogbookHandler(parent=self) |
| 473 | + LogbookHandler(parent=self) |
475 | 474 |
|
476 | 475 | # autoNOM |
477 | 476 |
|
@@ -921,32 +920,33 @@ def apply_clicked(self): |
921 | 920 | self.close() |
922 | 921 |
|
923 | 922 |
|
924 | | -def main(mode): |
| 923 | +def main(config=None): |
| 924 | + |
| 925 | + if config is None: |
| 926 | + import argparse # noqa |
| 927 | + parser = argparse.ArgumentParser(description='ADvanced DIffraction Environment') |
| 928 | + parser.add_argument('--version', action='version', version='%(prog)s version {}'.format(__version__)) |
| 929 | + parser.add_argument('--mode', type=str, default='mantid', |
| 930 | + help='Set processing mode (default=%(default)s)', choices=['mantid', 'idl']) |
| 931 | + |
| 932 | + try: # set up bash completion as a soft dependency |
| 933 | + import argcomplete # noqa |
| 934 | + argcomplete.autocomplete(parser) |
| 935 | + except ImportError: |
| 936 | + pass # silently skip this |
| 937 | + |
| 938 | + # parse the command line options |
| 939 | + config = parser.parse_args() |
| 940 | + |
925 | 941 | app = QApplication(sys.argv) |
926 | | - app.setOrganizationName("Qtrac Ltd.") |
927 | | - app.setOrganizationDomain("qtrac.eu") |
928 | | - app.setApplicationName("Image Changer") |
| 942 | + app.setOrganizationName("ORNL / SNS") |
| 943 | + app.setOrganizationDomain("https://neutrons.ornl.gov/") |
| 944 | + app.setApplicationName("ADDIE: ADvanced DIffraction Environment") |
929 | 945 | app.setWindowIcon(QIcon(":/icon.png")) |
930 | | - form = MainWindow(processing_mode=mode) |
| 946 | + form = MainWindow(processing_mode=config.mode) |
931 | 947 | form.show() |
932 | 948 | app.exec_() |
933 | 949 |
|
934 | 950 |
|
935 | 951 | if __name__ == '__main__': |
936 | | - import argparse # noqa |
937 | | - parser = argparse.ArgumentParser(description='ADvanced DIffraction Environment') |
938 | | - parser.add_argument('--version', action='version', version='%(prog)s version {}'.format(__version__)) |
939 | | - parser.add_argument('--mode', type=str, default='mantid', |
940 | | - help='Set processing mode (default=%(default)s)', choices=['mantid', 'idl']) |
941 | | - |
942 | | - try: # set up bash completion as a soft dependency |
943 | | - import argcomplete # noqa |
944 | | - argcomplete.autocomplete(parser) |
945 | | - except ImportError: |
946 | | - pass # silently skip this |
947 | | - |
948 | | - # parse the command line options |
949 | | - options = parser.parse_args() |
950 | | - |
951 | | - # start the main program |
952 | | - main(options.mode) |
| 952 | + main() |
0 commit comments