@@ -44,6 +44,7 @@ class CommandSpec:
4444
4545
4646_MOUSE_BUTTONS = ("mouse_left" , "mouse_right" , "mouse_middle" )
47+ _REGION_PLACEHOLDER = "[left, top, right, bottom]"
4748
4849
4950def _build_specs () -> List [CommandSpec ]:
@@ -262,7 +263,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
262263 FieldSpec ("scales" , FieldType .STRING , optional = True ,
263264 placeholder = "[0.9, 1.0, 1.1]" ),
264265 FieldSpec ("region" , FieldType .STRING , optional = True ,
265- placeholder = "[left, top, right, bottom]" ),
266+ placeholder = _REGION_PLACEHOLDER ),
266267 ),
267268 description = "Locate a template and return its confidence score + scale." ,
268269 ))
@@ -286,7 +287,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
286287 FieldSpec ("min_score" , FieldType .FLOAT , optional = True , default = 0.9 ,
287288 min_value = 0.0 , max_value = 1.0 ),
288289 FieldSpec ("region" , FieldType .STRING , optional = True ,
289- placeholder = "[left, top, right, bottom]" ),
290+ placeholder = _REGION_PLACEHOLDER ),
290291 ),
291292 description = "Match counting only opaque/masked pixels (alpha or mask)." ,
292293 ))
@@ -310,7 +311,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
310311 FieldSpec ("tolerance" , FieldType .INT , optional = True , default = 20 ),
311312 FieldSpec ("min_area" , FieldType .INT , optional = True , default = 50 ),
312313 FieldSpec ("region" , FieldType .STRING , optional = True ,
313- placeholder = "[left, top, right, bottom]" ),
314+ placeholder = _REGION_PLACEHOLDER ),
314315 ),
315316 description = "Locate regions by colour (status light / banner / fill)." ,
316317 ))
@@ -322,7 +323,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
322323 FieldSpec ("ignore" , FieldType .STRING , optional = True ,
323324 placeholder = "[[x, y, w, h], ...]" ),
324325 FieldSpec ("region" , FieldType .STRING , optional = True ,
325- placeholder = "[left, top, right, bottom]" ),
326+ placeholder = _REGION_PLACEHOLDER ),
326327 ),
327328 description = "Structural-similarity score (0..1) vs reference / screen." ,
328329 ))
@@ -337,7 +338,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
337338 min_value = 0.0 , max_value = 1.0 ),
338339 FieldSpec ("min_area" , FieldType .INT , optional = True , default = 50 ),
339340 FieldSpec ("region" , FieldType .STRING , optional = True ,
340- placeholder = "[left, top, right, bottom]" ),
341+ placeholder = _REGION_PLACEHOLDER ),
341342 ),
342343 description = "Boxes of the regions that structurally changed." ,
343344 ))
@@ -346,7 +347,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
346347 fields = (
347348 FieldSpec ("template" , FieldType .FILE_PATH ),
348349 FieldSpec ("region" , FieldType .STRING , optional = True ,
349- placeholder = "[left, top, right, bottom]" ),
350+ placeholder = _REGION_PLACEHOLDER ),
350351 FieldSpec ("max_features" , FieldType .INT , optional = True , default = 500 ),
351352 FieldSpec ("ratio" , FieldType .FLOAT , optional = True , default = 0.75 ,
352353 min_value = 0.0 , max_value = 1.0 ),
@@ -358,7 +359,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
358359 "AC_find_shapes" , "Image" , "Find Shapes" ,
359360 fields = (
360361 FieldSpec ("region" , FieldType .STRING , optional = True ,
361- placeholder = "[left, top, right, bottom]" ),
362+ placeholder = _REGION_PLACEHOLDER ),
362363 FieldSpec ("min_area" , FieldType .INT , optional = True , default = 400 ),
363364 FieldSpec ("max_area" , FieldType .INT , optional = True ),
364365 ),
@@ -368,7 +369,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
368369 "AC_find_rectangles" , "Image" , "Find Rectangles" ,
369370 fields = (
370371 FieldSpec ("region" , FieldType .STRING , optional = True ,
371- placeholder = "[left, top, right, bottom]" ),
372+ placeholder = _REGION_PLACEHOLDER ),
372373 FieldSpec ("min_area" , FieldType .INT , optional = True , default = 400 ),
373374 FieldSpec ("max_area" , FieldType .INT , optional = True ),
374375 FieldSpec ("aspect_range" , FieldType .STRING , optional = True ,
@@ -387,7 +388,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
387388 placeholder = "grayscale,upscale,binarize" ),
388389 FieldSpec ("scale" , FieldType .FLOAT , optional = True , default = 2.0 ),
389390 FieldSpec ("region" , FieldType .STRING , optional = True ,
390- placeholder = "[left, top, right, bottom]" ),
391+ placeholder = _REGION_PLACEHOLDER ),
391392 ),
392393 description = "Clean up an image for OCR / matching (grayscale/binarize/…)." ,
393394 ))
@@ -398,7 +399,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
398399 FieldSpec ("upper_hsv" , FieldType .STRING , placeholder = "[80, 255, 255]" ),
399400 FieldSpec ("min_area" , FieldType .INT , optional = True , default = 50 ),
400401 FieldSpec ("region" , FieldType .STRING , optional = True ,
401- placeholder = "[left, top, right, bottom]" ),
402+ placeholder = _REGION_PLACEHOLDER ),
402403 ),
403404 description = "Locate regions inside an HSV band (lighting-robust)." ,
404405 ))
@@ -411,7 +412,7 @@ def _add_image_specs(specs: List[CommandSpec]) -> None:
411412 FieldSpec ("val_min" , FieldType .INT , optional = True , default = 80 ),
412413 FieldSpec ("min_area" , FieldType .INT , optional = True , default = 50 ),
413414 FieldSpec ("region" , FieldType .STRING , optional = True ,
414- placeholder = "[left, top, right, bottom]" ),
415+ placeholder = _REGION_PLACEHOLDER ),
415416 ),
416417 description = "Locate any shade of a hue, any brightness (handles red wrap)." ,
417418 ))
@@ -708,7 +709,7 @@ def _add_flow_specs(specs: List[CommandSpec]) -> None:
708709 FieldSpec ("min_score" , FieldType .FLOAT , optional = True , default = 0.8 ,
709710 min_value = 0.0 , max_value = 1.0 ),
710711 FieldSpec ("region" , FieldType .STRING , optional = True ,
711- placeholder = "[left, top, right, bottom]" ),
712+ placeholder = _REGION_PLACEHOLDER ),
712713 ),
713714 description = "Wait until a target is visible + stable before acting." ,
714715 ))
@@ -766,7 +767,7 @@ def _add_flow_specs(specs: List[CommandSpec]) -> None:
766767 fields = (
767768 FieldSpec ("target_rgb" , FieldType .STRING , placeholder = "[0, 200, 0]" ),
768769 FieldSpec ("region" , FieldType .STRING , optional = True ,
769- placeholder = "[left, top, right, bottom]" ),
770+ placeholder = _REGION_PLACEHOLDER ),
770771 FieldSpec ("tolerance" , FieldType .INT , optional = True , default = 10 ),
771772 FieldSpec ("min_fraction" , FieldType .FLOAT , optional = True ,
772773 default = 0.5 , min_value = 0.0 , max_value = 1.0 ),
0 commit comments