forked from markciecior/ConnectPyse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
32 lines (28 loc) · 929 Bytes
/
__init__.py
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
import base64
import json
from os import path
import sys
from .config import *
from .cw_controller import *
#from .cw_info import all
from .cw_model import *
from .restapi import *
# sys.path.insert(0, path.dirname(path.abspath(__file__)))
# api_file = 'my_api.json'
# _api_file = path.join(path.dirname(path.abspath(__file__)), api_file)
# with open(_api_file) as fin:
# cw_api_settings = json.load(fin)
#
# API_URL = cw_api_settings['API_URL']
# _cid = cw_api_settings['COMPANYID']
# _pubk = cw_api_settings['PUBLICKEY']
# _privk = cw_api_settings['PRIVATEKEY']
# _authtoken = cw_api_settings['AUTHTOKEN']
#
# if (_authtoken is not None) and (_authtoken != "xxxxx"):
# basic_auth = _authtoken
#
# else:
#
# basic_auth = base64.b64encode("{}+{}:{}".format(_cid, _pubk, _privk).encode('utf-8'))
# basic_auth = {'Authorization': 'Basic {}'.format(str(basic_auth, 'utf-8'))}