Skip to content

Commit 3c610da

Browse files
resolve conflict
2 parents 22c2f9e + 9f86984 commit 3c610da

26 files changed

+108
-43
lines changed

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ matrix:
88
- os: linux
99
python: 3.6
1010
install:
11-
- pip install -r test-requirements.txt
11+
- pip install -r requirements/test.txt
12+
- pip install -r requirements/sdk.txt
13+
1214
script:
13-
- flake8 connectsdk
15+
- flake8 connect
16+
- pytest
17+
1418
deploy:
1519
password:
1620
secure: nzWd7Fqgi/K5YKqrAPkIBkgRImWQyQgD2/qP3fYksyJnIFWNcea5T4EKqQKXIPZHh1K0cRhT7mSjIfIrQ6H3XKM/eMTAlz6pbisG2cuu4ueUBjbxHCVCkwzBPgF7+DuCJUXJ/SHyoqMnTdAQo8fb8g69/UCmnUp37YoDO1YHXIMjFVkNc6PFS7nQElXnWkvWd1SpQgA1ZdWdwBzEnIiq+L6IFeTa83PH0Schkem/vR9Ql9CmuliovNt3yHfFaeIqLUgOmsfrwOtDVs0/SkcF+Gg5tNds7DHH2TR4fHco5s8F+n4FVgv2DUPlvBbOVvUH1RiRB8hdATetUxe1cU8fT1nPdJASLWS5E4b4knGLH53+bGxqPVezHxghbVYZHPXp7yI1zWX/Wtn9MBiAo9S3f+Tf8zTk5PIjAJLG/Sdn0RX8mLn89fsslku3enH/FknwPtG+xVYSzUlrd+yzHKnqYkKJzMjsBq/F5+shmYSDlnGdGv+Ga3xZSjIoXlphO5qpxR7vrGnLMxEPJC06+mPgPZp1qfDMyrei/IAPRP8qYPC+Vnj8yclH/UyBKT66z2UEP1z5Op99fUXi3W59x2zdVaLHYniNf16UqtrE5kc7gdLvVcH+NtbO716SAbvO5ql/JsYYTmDSoWEC9KWZS+4E7p7n45c8DEieg8Q5HThWF9Y=

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include requirements/sdk.txt
2+
include connect/logger/config.json
3+
include VERSION

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Connect Python SDK
2-
2+
[![Build Status](https://travis-ci.org/ingrammicro/connect-python-sdk.svg?branch=master)](https://travis-ci.org/ingrammicro/connect-python-sdk)
33
### Getting Started
44
---
55
### Class Features

connect/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import resource
2+
3+
name = 'connect'
4+
5+
__all__ = [
6+
'config',
7+
'resource',
8+
'models',
9+
'logger',
10+
]
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
13
import json
24
import os
35

@@ -86,9 +88,13 @@ def load_from_file(self, file):
8688
raise TypeError('Invalid config file `{}`\n'
8789
'ERROR: {}'.format(file, str(ex)))
8890

89-
(api_url, api_key, products) = (configs.get('apiEndpoint'),
90-
configs.get('apiKey'),
91-
configs.get('products'))
91+
(api_url, api_key, products) = (configs.get('apiEndpoint', ''),
92+
configs.get('apiKey', ''),
93+
configs.get('products', ''))
94+
95+
products = products.encode('utf-8') if not isinstance(products, (str, list)) else products
96+
api_url = api_url.encode('utf-8') if not isinstance(api_url, str) else api_url
97+
api_key = api_key.encode('utf-8') if not isinstance(api_key, str) else api_key
9298

9399
self.check_credentials(api_url, api_key, products)
94100
self._set_attr(api_url, api_key, products)
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# -*- coding: utf-8 -*-
2+
13
import json
24
import logging
35
import os
46
from logging.config import dictConfig
57

6-
with open(os.path.join(os.path.dirname(__file__), 'config.json'), encoding="utf-8") as config_file:
8+
with open(os.path.join(os.path.dirname(__file__), 'config.json')) as config_file:
79
config = json.load(config_file)
810

911
dictConfig(config['logging'])
@@ -20,4 +22,5 @@ def decorator(self, *args, **kwargs):
2022
logger.debug(
2123
'Function `{}.{}` return: {}'.format(self.__class__.__name__, func.__name__, result))
2224
return result
25+
2326
return decorator

0 commit comments

Comments
 (0)