Compare commits

...

5 Commits

Author SHA1 Message Date
ann-christin
207d0b3a6f [update] directly pass args from arg parser 2022-11-14 11:18:15 +01:00
ann-christin
3b3bbc29d1 Merge remote-tracking branch 'origin/develop' into develop 2022-11-14 10:30:38 +01:00
ann-christin
a8c6f4c972 [reformat] spell checking 2022-08-25 15:31:08 +02:00
ann-christin
0d91f9e3fe update github link 2022-08-25 14:03:05 +02:00
ann-christin
494d281d61 update github link 2022-08-25 14:00:37 +02:00

View File

@ -481,7 +481,7 @@ class MainWindow(QMainWindow):
"automatic pick "
"data.", False)
self.compare_action.setEnabled(False)
self.qualities_action = self.createAction(parent=self, text='Show pick qualitites...',
self.qualities_action = self.createAction(parent=self, text='Show pick qualities...',
slot=self.pickQualities, shortcut='Alt+Q',
icon=qualities_icon, tip='Histogram of pick qualities')
self.qualities_action.setEnabled(False)
@ -1181,7 +1181,7 @@ class MainWindow(QMainWindow):
'''
if not self.project:
self.createNewProject()
ed = getExistingDirectories(self, 'Select event directories...')
ed = GetExistingDirectories(self, 'Select event directories...')
if ed.exec_():
eventlist = [event for event in ed.selectedFiles() if not event.endswith('EVENTS-INFO')]
basepath = eventlist[0].split(os.path.basename(eventlist[0]))[0]
@ -2898,7 +2898,9 @@ class MainWindow(QMainWindow):
self.log_deleted_picks([deleted_pick])
def log_deleted_picks(self, deleted_picks, event_path=None):
''' Log deleted picks to list self.deleted_picks '''
'''
Log deleted picks to list self.deleted_picks
'''
if not event_path:
event_path = self.get_current_event_path()
for deleted_pick in deleted_picks:
@ -2912,7 +2914,9 @@ class MainWindow(QMainWindow):
self.deleted_picks[event_path].append(deleted_pick)
def dump_deleted_picks(self, event_path):
''' Save deleted picks to json file for event in event_path. Load old file before and merge'''
'''
Save deleted picks to json file for event in event_path. Load old file before and merge
'''
try:
deleted_picks_from_file = self.load_deleted_picks(event_path)
except Exception as e:
@ -3822,7 +3826,7 @@ class MainWindow(QMainWindow):
def helpHelp(self):
if checkurl():
form = HelpForm(self,
'https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/wiki')
'https://github.com/seismology-RUB/PyLoT')
else:
form = HelpForm(self, ':/help.html')
form.show()
@ -4002,13 +4006,13 @@ class Project(object):
return project
class getExistingDirectories(QFileDialog):
class GetExistingDirectories(QFileDialog):
'''
File dialog with possibility to select multiple folders.
'''
def __init__(self, *args):
super(getExistingDirectories, self).__init__(*args)
super(GetExistingDirectories, self).__init__(*args)
self.setOption(self.DontUseNativeDialog, True)
self.setOption(self.ReadOnly, True)
self.setFileMode(self.Directory)
@ -4034,16 +4038,7 @@ def create_window():
return app, app_created
def main(args=None):
project_filename = None
# args.project_filename = 'C:/Shared/AlpArray/alparray_data/project_alparray_test.plp'
pylot_infile = None
if args:
if args.project_filename:
project_filename = args.project_filename
if args.input_filename:
pylot_infile = args.input_filename
reset_qsettings = args.reset_qsettings
def main(project_filename=None, pylot_infile=None, reset_qsettings=False):
# create the Qt application
pylot_app, app_created = create_window()
@ -4092,4 +4087,5 @@ if __name__ == "__main__":
parser.add_argument('--reset_qsettings', default=False, action='store_true',
help='reset qsettings (debug option)')
args = parser.parse_args()
sys.exit(main(args))
sys.exit(main(project_filename=args.project_filename, pylot_infile=args.input_filename,
reset_qsettings=args.reset_qsettings))