3 from __future__
import print_function
14 if osp.isfile(osp.expanduser(auth_token)):
15 with open(osp.expanduser(auth_token),
'r') as f: 16 auth_token = f.readline().rstrip() 19 'https://api.candyhouse.co/public/sesames',
20 headers={
'Authorization': auth_token})
21 if ret.status_code == 200:
22 pprint.pprint(ret.json())
24 print(
'[HTTP status code: {}]\n' 26 'No Sesames found.'.format(
27 ret.status_code, ret.text), file=sys.stderr)
30 if __name__ ==
'__main__':
31 parser = argparse.ArgumentParser()
33 'auth_token', type=str,
34 help=
'Your authorization token or path to its file.')
35 args = parser.parse_args()
def list_sesames(auth_token)