MCPcopy Index your code
hub / github.com/dbcli/mycli / apply_casing

Method apply_casing

mycli/sqlcompleter.py:1353–1367  ·  view source on GitHub ↗
(
        self,
        completions: list[tuple[str, int]],
        casing: str | None,
    )

Source from the content-addressed store, hash-verified

1351 return 'lower' if last and (last[0].islower() or last[-1].islower()) else 'upper'
1352
1353 def apply_casing(
1354 self,
1355 completions: list[tuple[str, int]],
1356 casing: str | None,
1357 ) -> Generator[tuple[str, int], None, None]:
1358 if casing is None:
1359 return (completion for completion in completions)
1360
1361 def apply_case(tup: tuple[str, int]) -> tuple[str, int]:
1362 kw, fuzziness = tup
1363 if casing == 'upper':
1364 return (kw.upper(), fuzziness)
1365 return (kw.lower(), fuzziness)
1366
1367 return (apply_case(completion) for completion in completions)
1368
1369 def find_matches(
1370 self,

Callers 2

find_matchesMethod · 0.95
test_apply_casingFunction · 0.95

Calls

no outgoing calls

Tested by 1

test_apply_casingFunction · 0.76