Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sym_api_client_python/hello.py → hello.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from configure.configure import Config
from auth.auth import Auth
from clients.SymBotClient import SymBotClient
from listeners.imListenerTestImp import IMListenerTestImp
from listeners.roomListenerTestImp import RoomListenerTestImp
from sym_api_client_python.configure.configure import Config
from sym_api_client_python.auth.auth import Auth
from sym_api_client_python.clients.SymBotClient import SymBotClient
from sym_api_client_python.listeners.imListenerTestImp import IMListenerTestImp
from sym_api_client_python.listeners.roomListenerTestImp import RoomListenerTestImp
#main() acts as executable script --> run python3 hello.py to start Bot...
def main():
print('hi')
#pass in path to config.json file to Config class
configure = Config('./resources/config.json')
configure = Config('sym_api_client_python/resources/config.json')
#parse through config.json and extract decrypt certificates
configure.connect()
#if you wish to authenticate using RSA replace following line with: auth = rsa_Auth(configure) --> get rid of auth.authenticate
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def readme():

setuptools.setup(
name="sym_api_client_python",
version="0.0.1",
version="0.0.3",
author="Reed Feldman",
author_email="reed.feldman@symphony.com",
description="Symphony REST API - Python Client",
Expand Down
10 changes: 5 additions & 5 deletions sym_api_client_python/DataFeedEventService.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import logging
from listeners import ConnectionListener
from listeners import imListener
from listeners import RoomListener
logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.WARNING)
from .listeners import ConnectionListener
from .listeners import imListener
from .listeners import RoomListener
# logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
# logging.getLogger("urllib3").setLevel(logging.WARNING)
#class handles the the creation and reading of DataFeed
#also contains the functionality to dispatch the events coming back from the dataFeed
#sends data over to listener where the event is handled
Expand Down
8 changes: 4 additions & 4 deletions sym_api_client_python/auth/auth.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json
import requests
import logging
from clients.apiClient import APIClient
from exceptions.UnauthorizedException import UnauthorizedException
logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.WARNING)
from ..clients.apiClient import APIClient
from ..exceptions.UnauthorizedException import UnauthorizedException
# logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
# logging.getLogger("urllib3").setLevel(logging.WARNING)

class Auth():
#initialize Auth object with config object and empty strings representing auth tokens
Expand Down
16 changes: 8 additions & 8 deletions sym_api_client_python/clients/DataFeedClient.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import requests
import json
from DataFeedEventService import DataFeedEventService
from ..DataFeedEventService import DataFeedEventService
import logging
from clients.apiClient import APIClient
from exceptions.APIClientErrorException import APIClientErrorException
from exceptions.ForbiddenException import ForbiddenException
from exceptions.ServerErrorException import ServerErrorException
from exceptions.UnauthorizedException import UnauthorizedException
logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.WARNING)
from .apiClient import APIClient
from ..exceptions.APIClientErrorException import APIClientErrorException
from ..exceptions.ForbiddenException import ForbiddenException
from ..exceptions.ServerErrorException import ServerErrorException
from ..exceptions.UnauthorizedException import UnauthorizedException
# logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
# logging.getLogger("urllib3").setLevel(logging.WARNING)

#child class of APIClient --> Extends error handling functionality
class DataFeedClient(APIClient):
Expand Down
14 changes: 7 additions & 7 deletions sym_api_client_python/clients/MessageClient.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import requests
import json
import logging
from clients.apiClient import APIClient
from exceptions.APIClientErrorException import APIClientErrorException
from exceptions.ForbiddenException import ForbiddenException
from exceptions.ServerErrorException import ServerErrorException
from exceptions.UnauthorizedException import UnauthorizedException
logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.WARNING)
from .apiClient import APIClient
from ..exceptions.APIClientErrorException import APIClientErrorException
from ..exceptions.ForbiddenException import ForbiddenException
from ..exceptions.ServerErrorException import ServerErrorException
from ..exceptions.UnauthorizedException import UnauthorizedException
# logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
# logging.getLogger("urllib3").setLevel(logging.WARNING)
#child class of APIClient --> Extends error handling functionality
#MessageClient class contains a series of functions corresponding to all messaging
#endpoints on the REST API.
Expand Down
14 changes: 7 additions & 7 deletions sym_api_client_python/clients/StreamClient.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import requests
import json
import logging
from clients.apiClient import APIClient
from exceptions.APIClientErrorException import APIClientErrorException
from exceptions.ServerErrorException import ServerErrorException
from exceptions.UnauthorizedException import UnauthorizedException
from exceptions.ForbiddenException import ForbiddenException
logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.WARNING)
from .apiClient import APIClient
from ..exceptions.APIClientErrorException import APIClientErrorException
from ..exceptions.ServerErrorException import ServerErrorException
from ..exceptions.UnauthorizedException import UnauthorizedException
from ..exceptions.ForbiddenException import ForbiddenException
# logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
# logging.getLogger("urllib3").setLevel(logging.WARNING)

#child class of APIClient --> Extends error handling functionality
#StreamClient class contains a series of functions corresponding to all stream
Expand Down
2 changes: 1 addition & 1 deletion sym_api_client_python/clients/SymBotClient.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .DataFeedClient import DataFeedClient
from DataFeedEventService import DataFeedEventService
from ..DataFeedEventService import DataFeedEventService
from .MessageClient import MessageClient
from .StreamClient import StreamClient
from .apiClient import APIClient
Expand Down
16 changes: 8 additions & 8 deletions sym_api_client_python/clients/UserClient.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import requests
import json
import logging
from DataFeedEventService import DataFeedEventService
from clients.apiClient import APIClient
from exceptions.APIClientErrorException import APIClientErrorException
from exceptions.ForbiddenException import ForbiddenException
from exceptions.ServerErrorException import ServerErrorException
from exceptions.UnauthorizedException import UnauthorizedException
logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.WARNING)
from ..DataFeedEventService import DataFeedEventService
from .apiClient import APIClient
from ..exceptions.APIClientErrorException import APIClientErrorException
from ..exceptions.ForbiddenException import ForbiddenException
from ..exceptions.ServerErrorException import ServerErrorException
from ..exceptions.UnauthorizedException import UnauthorizedException
# logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
# logging.getLogger("urllib3").setLevel(logging.WARNING)

#child class of APIClient --> Extends error handling functionality
#UserClient class contains a series of functions corresponding to all messaging
Expand Down
12 changes: 6 additions & 6 deletions sym_api_client_python/clients/apiClient.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# from clients import SymBotClient
import logging
from exceptions.APIClientErrorException import APIClientErrorException
from exceptions.ServerErrorException import ServerErrorException
from exceptions.UnauthorizedException import UnauthorizedException
from exceptions.ForbiddenException import ForbiddenException
logging.basicConfig(filename='logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.WARNING)
from ..exceptions.APIClientErrorException import APIClientErrorException
from ..exceptions.ServerErrorException import ServerErrorException
from ..exceptions.UnauthorizedException import UnauthorizedException
from ..exceptions.ForbiddenException import ForbiddenException
# logging.basicConfig(filename='..logs/example.log', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', filemode='w', level=logging.DEBUG)
# logging.getLogger("urllib3").setLevel(logging.WARNING)
#error handling class --> take status code and raise appropriate exceptions
#this class acts as a parent class to each of the other client class.
#each child class extends error handling functionality
Expand Down
4 changes: 2 additions & 2 deletions sym_api_client_python/configure/configure.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json
import requests
import sys
from configure.crypt import Crypt
# from ..crypt.crypt import Crypt
# from configure.crypt import Crypt
from ..configure.crypt import Crypt

class Config():
#initialize object by passing in config file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from listeners.ConnectionListener import ConnectionListener
from .ConnectionListener import ConnectionListener

#sample implementation of Abstract imListener class
#has instance of SymBotClient so that it can respond to events coming in by leveraging other clients on SymBotClient
Expand Down
2 changes: 1 addition & 1 deletion sym_api_client_python/listeners/imListenerTestImp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from listeners.imListener import IMListener
from .imListener import IMListener

#sample implementation of Abstract imListener class
#has instance of SymBotClient so that it can respond to events coming in by leveraging other clients on SymBotClient
Expand Down
2 changes: 1 addition & 1 deletion sym_api_client_python/listeners/roomListenerTestImp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from listeners.RoomListener import RoomListener
from .RoomListener import RoomListener
import calendar;
import time;

Expand Down
6 changes: 3 additions & 3 deletions sym_api_client_python/logs/example.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2018-07-24 17:53:30,105 - root - DEBUG - Auth/authenticate() --> needed to authenticate
2018-07-24 17:53:30,106 - root - DEBUG - Auth/get_session_token()
2018-07-24 17:53:30,904 - root - DEBUG - Auth/get_keyauth()
2018-07-24 17:55:40,686 - root - DEBUG - Auth/authenticate() --> needed to authenticate
2018-07-24 17:55:40,686 - root - DEBUG - Auth/get_session_token()
2018-07-24 17:55:41,398 - root - DEBUG - Auth/get_keyauth()