def main(argv=sys.argv): opt, args = parse(argv[1:]) if opt.verbose: logger.setLevel("INFO") logger.info("Input arguments: %s", sys.argv) # Global keywords for Glue startup. kwargs = {'config': opt.config, 'maximized': not opt.nomax} if opt.test: return run_tests() elif opt.restore: start_glue(gluefile=args[0], **kwargs) elif opt.script: execute_script(args[0]) else: has_file = len(args) == 1 has_files = len(args) > 1 has_py = has_file and args[0].endswith('.py') has_glu = has_file and args[0].endswith('.glu') if has_py: execute_script(args[0]) elif has_glu: start_glue(gluefile=args[0], **kwargs) elif has_file or has_files: start_glue(datafiles=args, **kwargs) else: start_glue(**kwargs)
def main(argv=sys.argv): opt, args = parse(argv[1:]) if opt.verbose: logger.setLevel("INFO") logger.info("Input arguments: %s", sys.argv) # Global keywords for Glue startup. kwargs = {'config': opt.config, 'maximized': not opt.nofs} if opt.test: return run_tests() elif opt.restore: start_glue(gluefile=args[0], **kwargs) elif opt.script: execute_script(args[0]) else: has_file = len(args) == 1 has_files = len(args) > 1 has_py = has_file and args[0].endswith('.py') has_glu = has_file and args[0].endswith('.glu') if has_py: execute_script(args[0]) elif has_glu: start_glue(gluefile=args[0], **kwargs) elif has_file or has_files: start_glue(datafiles=args, **kwargs) else: start_glue(**kwargs)
def main(argv=sys.argv): opt, args = parse(argv[1:]) if opt.verbose: logger.setLevel("INFO") logger.info("Input arguments: %s", sys.argv) if opt.test: return run_tests() elif opt.restore: start_glue(gluefile=args[0], config=opt.config) elif opt.script: execute_script(args[0]) else: has_file = len(args) == 1 has_files = len(args) > 1 has_py = has_file and args[0].endswith('.py') has_glu = has_file and args[0].endswith('.glu') if has_py: execute_script(args[0]) elif has_glu: start_glue(gluefile=args[0], config=opt.config) elif has_file or has_files: start_glue(datafiles=args, config=opt.config) else: start_glue(config=opt.config)
def main(argv=sys.argv): opt, args = parse(argv[1:]) if opt.verbose: logger.setLevel("INFO") if opt.faulthandler: import faulthandler faulthandler.enable() logger.info("Input arguments: %s", sys.argv) # Global keywords for Glue startup. kwargs = { 'config': opt.config, 'maximized': not opt.nomax, 'auto_merge': opt.auto_merge } if opt.startup: kwargs['startup_actions'] = opt.startup.split(',') if opt.test: return run_tests() elif opt.restore: start_glue(gluefile=args[0], **kwargs) elif opt.script: execute_script(args[0]) else: has_file = len(args) == 1 has_files = len(args) > 1 has_py = has_file and args[0].endswith('.py') has_glu = has_file and args[0].endswith('.glu') if has_py: execute_script(args[0]) elif has_glu: start_glue(gluefile=args[0], **kwargs) elif has_file or has_files: start_glue(datafiles=args, **kwargs) else: start_glue(**kwargs)
self.fitEvent.emit(self.mode) def _subtract(self): self.subtractEvent.emit(self.mode) @property def mode(self): if self.tab_name == "Fit Line": return self._line_mode.checkedButton().objectName().replace('radio_', '') else: return self._cont_mode.checkedButton().objectName().replace('radio_', '') if __name__ == "__main__": log.setLevel("DEBUG") app = get_qapp() control = ControlPanel() def notify(mode): log.debug("Setting mode to '{0}' in pyspeckit control panel".format(mode)) control.modeChanged.connect(notify) def notify_fit(mode): log.debug("Fitting in '{0}' mode in pyspeckit".format(mode)) control.fitEvent.connect(notify_fit)