File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
from mangopaysdk .tools import enums
2
2
import logging
3
+ import tempfile
3
4
4
5
5
6
class Configuration :
@@ -15,7 +16,7 @@ class Configuration:
15
16
BaseUrl = 'https://api.sandbox.mangopay.com'
16
17
17
18
# path to temp - required to cache auth tokens
18
- TempPath = "c:\Temp\\ "
19
+ TempPath = tempfile . tempdir or "c:\Temp"
19
20
20
21
# Constant to switch debug mode (0/1) - display all request and response data
21
22
DebugMode = 0
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def Get(self):
14
14
"""Gets the currently stored objects as dictionary.
15
15
return stored Token dictionary or null.
16
16
"""
17
- DefaultStorageStrategy .cache_path = Configuration .TempPath + "cached-data.py"
17
+ DefaultStorageStrategy .cache_path = os . path . join ( Configuration .TempPath , "cached-data.py" )
18
18
19
19
if not os .path .exists (DefaultStorageStrategy .cache_path ):
20
20
return None
@@ -39,7 +39,7 @@ def Store(self, obj):
39
39
"""Stores authorization token passed as an argument.
40
40
param obj instance to be stored.
41
41
"""
42
- DefaultStorageStrategy .cache_path = Configuration .TempPath + "cached-data.py"
42
+ DefaultStorageStrategy .cache_path = os . path . join ( Configuration .TempPath , "cached-data.py" )
43
43
44
44
if obj == None :
45
45
return
You can’t perform that action at this time.
0 commit comments