FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-api/plotly/files.py at master · kayarre/python-api · GitHub
kayarre
/
python-api
Public
forked from
plotly/plotly.py
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-api
/
plotly
/
files.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (36 loc) · 1.52 KB
Breadcrumbs
python-api
/
plotly
/
files.py
Copy path
File metadata and controls
41 lines (36 loc) · 1.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import
os
# file structure
PLOTLY_DIR
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
"~"
),
".plotly"
)
CREDENTIALS_FILE
=
os
.
path
.
join
(
PLOTLY_DIR
,
".credentials"
)
CONFIG_FILE
=
os
.
path
.
join
(
PLOTLY_DIR
,
".config"
)
GRAPH_REFERENCE_FILE
=
os
.
path
.
join
(
PLOTLY_DIR
,
".graph_reference"
)
TEST_DIR
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
"~"
),
".test"
)
TEST_FILE
=
os
.
path
.
join
(
PLOTLY_DIR
,
".permission_test"
)
# this sets both the DEFAULTS and the TYPES for these files
FILE_CONTENT
=
{
CREDENTIALS_FILE
: {
'username'
:
''
,
'api_key'
:
''
,
'proxy_username'
:
''
,
'proxy_password'
:
''
,
'stream_ids'
: []},
CONFIG_FILE
: {
'plotly_domain'
:
'https://plot.ly'
,
'plotly_streaming_domain'
:
'stream.plot.ly'
,
'plotly_api_domain'
:
'https://api.plot.ly'
,
'plotly_ssl_verification'
:
True
,
'plotly_proxy_authorization'
:
False
,
'world_readable'
:
True
,
'sharing'
:
'public'
,
'auto_open'
:
True
}}
try
:
os
.
mkdir
(
TEST_DIR
)
os
.
rmdir
(
TEST_DIR
)
if
not
os
.
path
.
exists
(
PLOTLY_DIR
):
os
.
mkdir
(
PLOTLY_DIR
)
f
=
open
(
TEST_FILE
,
'w'
)
f
.
write
(
'testing
\n
'
)
f
.
close
()
os
.
remove
(
TEST_FILE
)
_file_permissions
=
True
except
:
_file_permissions
=
False
def
check_file_permissions
():
return
_file_permissions
Back
|
FazBrowse Home
|
New Git URL