| Conditions | 4 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from pathlib import Path |
||
| 21 | def _call(signature: str, show_error: bool = True) -> bool: |
||
| 22 | functions = FUNCTIONS.read_text("utf-8") |
||
| 23 | |||
| 24 | log.debug(f"Calling AppleScript: {signature}") |
||
| 25 | result = applescript.run(functions + "\n\n" + signature) |
||
| 26 | |||
| 27 | if result.out: |
||
| 28 | log.debug(f"AppleScript output: {result.out}") |
||
| 29 | if result.err: |
||
| 30 | log.debug(f"AppleScript error: {result.err}") |
||
| 31 | if show_error: |
||
| 32 | message = result.err.split("error:")[-1].strip() |
||
| 33 | log.error(message) |
||
| 34 | |||
| 35 | return result.code == 0 |
||
| 36 |