()
| 7 | |
| 8 | |
| 9 | def _permissions(): |
| 10 | try: |
| 11 | if not os.path.exists(PLOTLY_DIR): |
| 12 | try: |
| 13 | os.mkdir(PLOTLY_DIR) |
| 14 | except Exception: |
| 15 | # in case of race |
| 16 | if not os.path.isdir(PLOTLY_DIR): |
| 17 | raise |
| 18 | with open(TEST_FILE, "w") as f: |
| 19 | f.write("testing\n") |
| 20 | try: |
| 21 | os.remove(TEST_FILE) |
| 22 | except Exception: |
| 23 | pass |
| 24 | return True |
| 25 | except Exception: # Do not trap KeyboardInterrupt. |
| 26 | return False |
| 27 | |
| 28 | |
| 29 | _file_permissions = None |
no test coverage detected