Skip to content

Commit 159e142

Browse files
authored
Fix non standard English double-colons (#1719)
Signed-off-by: Douglas Samuel Gonçalves <[email protected]>
1 parent fc9b567 commit 159e142

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

plugins/slicer/MONAILabel/MONAILabel.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ def invalidateConfigTable(self, selection=-1, name=-1):
804804
v.insert(0, value)
805805
value = v
806806

807-
logging.info(f"Invalidate:: {section} => {name} => {key} => {value} => {type(v)}")
807+
logging.info(f"Invalidate: {section} => {name} => {key} => {value} => {type(v)}")
808808
self.info.get(section, {}).get(name, {}).get("config", {})[key] = value
809809

810810
def updateConfigTable(self, refresh=True):
@@ -1091,7 +1091,7 @@ def fetchInfo(self, showInfo=False):
10911091
)
10921092
return
10931093
except BaseException as e:
1094-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1094+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
10951095
slicer.util.errorDisplay(
10961096
_(
10971097
"Failed to fetch models from remote server. "
@@ -1165,7 +1165,7 @@ def onTraining(self):
11651165
time.sleep(1)
11661166
self.updateGUIFromParameterNode()
11671167
except BaseException as e:
1168-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1168+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
11691169
slicer.util.errorDisplay(
11701170
_("Failed to run training in MONAI Label Server.\n{message}").format(message=msg),
11711171
detailedText=traceback.format_exc(),
@@ -1197,7 +1197,7 @@ def onStopTraining(self):
11971197
self.updateServerSettings()
11981198
status = self.logic.train_stop()
11991199
except BaseException as e:
1200-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1200+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
12011201
slicer.util.errorDisplay(
12021202
_("Failed to stop Training Task.\n{message}").format(message=msg),
12031203
detailedText=traceback.format_exc(),
@@ -1313,7 +1313,7 @@ def onNextSampleButton(self):
13131313
self.initSample(sample)
13141314

13151315
except BaseException as e:
1316-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1316+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
13171317
slicer.util.errorDisplay(
13181318
_("Failed to fetch Sample from MONAI Label Server.\n{message}").format(message=msg),
13191319
detailedText=traceback.format_exc(),
@@ -1401,12 +1401,12 @@ def onUploadImage(self, init_sample=True, session=False):
14011401
self.updateGUIFromParameterNode()
14021402
return True
14031403
except BaseException as e:
1404-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1404+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
14051405
self.reportProgress(100)
14061406
qt.QApplication.restoreOverrideCursor()
14071407
if session:
14081408
slicer.util.errorDisplay(
1409-
_("Server Error:: Session creation Failed\nPlease upgrade to latest monailabel version (> 0.2.0)"),
1409+
_("Server Error: Session creation Failed\nPlease upgrade to latest monailabel version (> 0.2.0)"),
14101410
detailedText=traceback.format_exc(),
14111411
)
14121412
self.current_sample["session"] = None
@@ -1496,7 +1496,7 @@ def onSaveLabel(self):
14961496
logging.info("Failed to stop training; or already stopped")
14971497
self.onTraining()
14981498
except BaseException as e:
1499-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1499+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
15001500
slicer.util.errorDisplay(
15011501
_("Failed to save Label to MONAI Label Server.\n{message}").format(message=msg),
15021502
detailedText=traceback.format_exc(),
@@ -1552,7 +1552,7 @@ def onClickSegmentation(self):
15521552
labels = [k for k, _ in sorted(labels.items(), key=lambda item: item[1])]
15531553
self.updateSegmentationMask(result_file, labels)
15541554
except BaseException as e:
1555-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1555+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
15561556
slicer.util.errorDisplay(
15571557
_("Failed to run inference in MONAI Label Server.\n{message}").format(message=msg),
15581558
detailedText=traceback.format_exc(),
@@ -1667,7 +1667,7 @@ def onClickDeepgrow(self, current_point, skip_infer=False):
16671667
freeze = label if self.ui.freezeUpdateCheckBox.checked else None
16681668
self.updateSegmentationMask(result_file, labels, None if deepgrow_3d else sliceIndex, freeze=freeze)
16691669
except BaseException as e:
1670-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1670+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
16711671
slicer.util.errorDisplay(
16721672
operationDescription + f" - unexpected error.\n{msg}",
16731673
detailedText=traceback.format_exc(),
@@ -1708,7 +1708,7 @@ def getLabelColor(self, name):
17081708
return [c / 255.0 for c in color] if color else None
17091709

17101710
def updateSegmentationMask(self, in_file, labels, sliceIndex=None, freeze=None):
1711-
# TODO:: Add ROI Node (for Bounding Box if provided in the result)
1711+
# TODO: Add ROI Node (for Bounding Box if provided in the result)
17121712
start = time.time()
17131713
logging.debug(f"Update Segmentation Mask from: {in_file}")
17141714
if in_file and not os.path.exists(in_file):
@@ -1974,7 +1974,7 @@ def onUpdateScribbles(self):
19741974
self.reportProgress(90)
19751975
self.updateSegmentationMask(result_file, [selected_label_name])
19761976
except BaseException as e:
1977-
msg = f"Message:: {e.msg}" if hasattr(e, "msg") else ""
1977+
msg = f"Message: {e.msg}" if hasattr(e, "msg") else ""
19781978
slicer.util.errorDisplay(
19791979
_("Failed to post process label on MONAI Label Server using {scribbles_method}.\n{message}").format(
19801980
scribbles_method=scribblesMethod, message=msg
@@ -2272,7 +2272,7 @@ def _client(self):
22722272
if self.auth_token:
22732273
mc.update_auth(self.auth_token)
22742274

2275-
# TODO:: JWT token can be validated (with additional py dependencies) to avoid further calls to server
2275+
# TODO: JWT token can be validated (with additional py dependencies) to avoid further calls to server
22762276
if not self.auth_token or not mc.auth_valid_token():
22772277
try:
22782278
print(f"Fetching new Token for: {self.username}")

0 commit comments

Comments
 (0)