Skip to content

Commit f9778cb

Browse files
Merge pull request #577 from czbiohub-sf/cli_entrypoints
Add entry points for CLI
2 parents b6c934d + 6b5eb48 commit f9778cb

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,12 @@ def readme():
5959
]
6060
},
6161
classifiers=["CZ Biohub :: Bioengineering"],
62+
entry_points={
63+
"console_scripts": [
64+
"remo-run=ulc_mm_package.QtGUI.oracle:main",
65+
"remo-dev=ulc_mm_package.QtGUI.dev_run:main",
66+
"remo-fix-focus=ulc_mm_package.utilities.coarse_focus_utility:main",
67+
"remo-pneumatic-calibration=ulc_mm_package.utilities.pneumatic_utility:main",
68+
]
69+
},
6270
)

ulc_mm_package/QtGUI/dev_run.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ def closeEvent(self, event):
11791179
self.close()
11801180

11811181

1182-
if __name__ == "__main__":
1182+
def main():
11831183
if path.isfile(LOCKFILE):
11841184
print(
11851185
f"Terminating run. Lockfile ({LOCKFILE}) exists, so scope is locked while another run is in progress."
@@ -1197,3 +1197,7 @@ def closeEvent(self, event):
11971197
app.exec_()
11981198
finally:
11991199
main_window.mscope.shutoff()
1200+
1201+
1202+
if __name__ == "__main__":
1203+
main()

ulc_mm_package/QtGUI/oracle.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ def __init__(self):
128128
mkdir(log_dir)
129129

130130
# Setup logger
131+
logger_config_path = Path(__file__).resolve().parent.parent / "logger.config"
131132
fileConfig(
132-
fname="../logger.config",
133+
fname=str(logger_config_path),
133134
defaults={
134135
"filename": path.join(log_dir, f"{self.datetime_str}.log"),
135136
"fileHandlerLevel": "DEBUG" if VERBOSE else "INFO",
@@ -474,7 +475,7 @@ def liveview_exit_handler(self):
474475
def error_handler(self, title, text, behavior, QR_code):
475476
if QR_code is not QR.NONE.value:
476477
if behavior == ERROR_BEHAVIORS.RELOAD.value:
477-
QR_msg = "\n\Try loading a new flow cell. If problem persists, scan QR code to troubleshoot."
478+
QR_msg = "\nTry loading a new flow cell. If problem persists, scan QR code to troubleshoot."
478479
else:
479480
QR_msg = "\n\nScan QR code to troubleshoot."
480481
else:
@@ -863,7 +864,7 @@ def emergency_shutoff(self):
863864
self.logger.info("EMERGENCY ORACLE SHUT OFF SUCCESSFUL.")
864865

865866

866-
if __name__ == "__main__":
867+
def main():
867868
app = ShutoffApplication(sys.argv)
868869
oracle = Oracle()
869870

@@ -884,3 +885,7 @@ def shutoff_excepthook(type, value, traceback):
884885
sys.excepthook = shutoff_excepthook
885886

886887
app.exec()
888+
889+
890+
if __name__ == "__main__":
891+
main()

0 commit comments

Comments
 (0)