slackmail/slack/__init__.py

37 lines
539 B
Python

#
# Copyright 2015 (c) Anna Schumaker
#
import sys
import os
path = os.path.realpath(sys.argv[0])
os.chdir(os.path.dirname(path))
from . import api
from . import auth
from . import channels
from . import users
#
# Verify connection and setup team information.
#
if api.test() == False:
print("Connection error, cannot continue.")
sys.exit(1)
__auth = auth.test()
if __auth == None:
sys.exit(1)
__TEAM = __auth["team"]
__USER = users.info(__auth["user_id"])
def team():
return __TEAM
def user():
return __USER