From 50d9f023cdb4f9ab3d40e02df8ebbfbf34149c65 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Oct 2014 14:37:05 +0100 Subject: [PATCH] small changes to run module --- client/client/__init__.py | 10 +++++++--- webservice/bam/application/__init__.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/client/__init__.py b/client/client/__init__.py index f2e5350..fccd82a 100755 --- a/client/client/__init__.py +++ b/client/client/__init__.py @@ -2,7 +2,10 @@ import requests -with open('config.json', 'r') as config: +import os +MODULE_DIR = os.path.dirname(__file__) + +with open(os.path.join(MODULE_DIR, 'config.json'), 'r') as config: import json config = json.load(config) @@ -15,8 +18,9 @@ def request_url(path): #print (r.json()) payload = { - 'filepath': 'pro', - 'command' : 'info'} + 'filepath': 'shots', + 'command' : 'info', + } r = requests.get(request_url('/file'), params=payload, auth=('bam', 'bam'), stream=True) local_filename = payload['filepath'].split('/')[-1] diff --git a/webservice/bam/application/__init__.py b/webservice/bam/application/__init__.py index 2365675..47e6a05 100644 --- a/webservice/bam/application/__init__.py +++ b/webservice/bam/application/__init__.py @@ -122,7 +122,7 @@ class FileAPI(Resource): log = r.log_default(None, None, 5, filepath) log = [l for l in log] - + return jsonify( filepath=filepath, log=log)