From 72837771e3f12d7ac374caacda1e5023c3c75747 Mon Sep 17 00:00:00 2001 From: Jack Urbanek Date: Tue, 26 Sep 2023 13:56:48 -0700 Subject: [PATCH] black --- .../abstractions/architects/mock_architect.py | 2 +- mephisto/scripts/export_qualification_list.py | 29 ++++++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/mephisto/abstractions/architects/mock_architect.py b/mephisto/abstractions/architects/mock_architect.py index 55c7e8f68..840a09a88 100644 --- a/mephisto/abstractions/architects/mock_architect.py +++ b/mephisto/abstractions/architects/mock_architect.py @@ -144,7 +144,7 @@ def __server_thread_fn(self): Main loop for the application """ self.running_instance = tornado.ioloop.IOLoop() - http_server = tornado.httpserver.HTTPServer(self, max_buffer_size=1024**3) + http_server = tornado.httpserver.HTTPServer(self, max_buffer_size=1024 ** 3) http_server.listen(self.port) self.running_instance.start() http_server.stop() diff --git a/mephisto/scripts/export_qualification_list.py b/mephisto/scripts/export_qualification_list.py index e0dc2f49c..f941fc367 100644 --- a/mephisto/scripts/export_qualification_list.py +++ b/mephisto/scripts/export_qualification_list.py @@ -14,42 +14,45 @@ table. This can be useful for bookkeeping, migrations, or sharing qual lists """ + def dump_qualifications(): db = LocalMephistoDB() - do_all = input('Provide comma separated list of specific qualifications to dump, otherwise all will be saved out.\n> ') + do_all = input( + "Provide comma separated list of specific qualifications to dump, otherwise all will be saved out.\n> " + ) if len(do_all.strip()) == 0: target_qualifications = db.find_qualifications() else: - target_qualification_names = do_all.split(',') + target_qualification_names = do_all.split(",") target_qualifications = [ - db.find_qualifications(qualification_name=n)[0] - for n in target_qualification_names + db.find_qualifications(qualification_name=n)[0] for n in target_qualification_names ] outfile_name = input("provide an output filename\n> ") result = {} for qualification in target_qualifications: - if qualification.qualification_name.endswith('sandbox'): + if qualification.qualification_name.endswith("sandbox"): continue print(f"Qualification: {qualification.qualification_name}") - description = input("Provide a useful description for what this qualification entails, blank to skip\n> ") + description = input( + "Provide a useful description for what this qualification entails, blank to skip\n> " + ) if len(description.strip()) == 0: continue qual_dict = {} granted_quals = db.check_granted_qualifications(qualification.db_id) for granted_qual in granted_quals: worker: Worker = Worker.get(db, granted_qual.worker_id) - if worker.worker_name.endswith('sandbox'): + if worker.worker_name.endswith("sandbox"): continue qual_dict[worker.worker_name] = granted_qual.value result[qualification.qualification_name] = { - 'description': description, - 'workers': qual_dict, + "description": description, + "workers": qual_dict, } - with open(outfile_name, 'w+') as outfile: + with open(outfile_name, "w+") as outfile: json.dump(result, outfile) - -if __name__ == '__main__': - dump_qualifications() \ No newline at end of file +if __name__ == "__main__": + dump_qualifications()