MCPcopy Index your code
hub / github.com/plotly/plotly.py / _permissions

Function _permissions

_plotly_utils/files.py:9–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9def _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

Callers 1

Calls 2

writeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected