I can call objects out of a method in a fashion that explicitly defines an endpoint ( this REST API is really a collection of RESTful endpoints ):
ie:
import symphony
pod_object = symphony.Pod(self.__uri__, self.__session__, self.__keymngr__)
agent_object = symphony.Agent(self.__uri__, self.__session__, self.__keymngr__)
agent.userid_by_email(email)
pod.send_message(userid, message)
This would be the __init__.py
for a Module symphony
from .Agent import Agent
from .Auth import Auth
from .Config import Config
from .Crypt import Crypt
from .Mml import Mml
from .Pod import Pod
from .RESTful import RESTful
This would be the __init__.py
for a Class Pod in Module symphony
class Pod():
# basic methods
from .base import sessioninfo
# user methods
from .users import get_userid_by_email
from .users import get_user_id_by_user
from .users import user_feature_update
from .users import search_user
# streams methods
from .streams import adduser_to_stream
from .streams import create_stream
from .streams import create_stream_ni
from .streams import create_room
from .streams import update_room
# group methods
from .groups import ib_group_list
from .groups import ib_group_member_list
from .groups import ib_group_member_add
from .groups import ib_group_policy_list
# connection methods
from .connections import list_connections
from .connections import connection_status
from .connections import accept_connection
from .connections import create_connection
def __init__(self, url, session, keymngr):
self.__url__ = url
self.__session__ = session
self.__keymngr__ = keymngr
self.__rest__ = symphony.RESTful(self.__url__, self.__session__, self.__keymngr__)
I have something like this. And I really like this.. Cause I can then have many classes divided into Dir structures with many methods divided into many files. Clean simple code. All registering to a module later on down the line.
But I have to individually register methods, instead of the entire file.
Is there some way to cleanly import all the methods in the files?
Python2 / 3 compatible way?