aesgcm_encrypt_text. Internal helper function. This docstring was added automatically to improve maintainability. Args: plaintext: Parameter. Returns: Varies.
(plaintext: str)
| 602 | def _bg_encrypt_file(tmp_plain: str, out_enc: str, finalize_fn): |
| 603 | """Encrypt tmp_plain -> out_enc in a background thread, then call finalize_fn(success:bool, err:str|None).""" |
| 604 | def worker(): |
| 605 | """worker. |
| 606 | |
| 607 | Route handler or application helper. |
| 608 | |
| 609 | This docstring was expanded to make future maintenance easier. |
| 610 | |
| 611 | Returns: |
| 612 | Varies. |
| 613 | """ |
| 614 | err = None |
| 615 | ok = False |
| 616 | try: |
| 617 | with open(tmp_plain, "rb") as fp: |
| 618 | aesgcm_encrypt_stream(fp, out_enc) |
| 619 | ok = True |
| 620 | except Exception as e: |
| 621 | err = str(e) |
| 622 | finally: |
| 623 | try: |
| 624 | if os.path.exists(tmp_plain): |
| 625 | os.remove(tmp_plain) |
no outgoing calls
no test coverage detected