slackmail/slack/__init__.py
Anna Schumaker bbe14fa88d slack: change directory before running
To help find the tokens file, mostly

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-05-26 21:32:00 -04:00

32 lines
449 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
#
# 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"]
def team():
return __TEAM