Return path of EMSCRIPTEN_TEMP_DIR, creating one if it didn't exist.
()
| 478 | # temp directory (TEMP_DIR/emscripten_temp). |
| 479 | @memoize |
| 480 | def get_emscripten_temp_dir(): |
| 481 | """Return path of EMSCRIPTEN_TEMP_DIR, creating one if it didn't exist.""" |
| 482 | global EMSCRIPTEN_TEMP_DIR |
| 483 | if not EMSCRIPTEN_TEMP_DIR: |
| 484 | EMSCRIPTEN_TEMP_DIR = tempfile.mkdtemp(prefix='emscripten_temp_', dir=TEMP_DIR) |
| 485 | |
| 486 | if not DEBUG_SAVE: |
| 487 | def prepare_to_clean_temp(d): |
| 488 | def clean_temp(): |
| 489 | utils.delete_dir(d) |
| 490 | |
| 491 | atexit.register(clean_temp) |
| 492 | # this global var might change later |
| 493 | prepare_to_clean_temp(EMSCRIPTEN_TEMP_DIR) |
| 494 | return EMSCRIPTEN_TEMP_DIR |
| 495 | |
| 496 | |
| 497 | def in_temp(name): |
no test coverage detected