Skip to content

Commit

Permalink
- Minor fixes to the sample gdalContour service config
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Nov 7, 2019
1 parent 37edd2c commit 9999b4c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/wpsremote/resource_monitor.py
Expand Up @@ -69,7 +69,7 @@ def proc_is_running(self, proc_defs):
import traceback
tb = traceback.format_exc()
logger.debug(tb)
print(tb)
# print(tb)
return False

def update_stats(self):
Expand Down
21 changes: 13 additions & 8 deletions src/wpsremote/xmpp_data/configs/myservice/code/test.py
Expand Up @@ -4,15 +4,16 @@
# This code is licensed under the GPL 2.0 license, available at the root
# application directory.

import subprocess
import logging.config
import logging
import argparse
import sys
import os
import sys
import time
import uuid
import zipfile
import time
import argparse
import subprocess

import logging
import logging.config

# constants
# id = os.urandom(10)
Expand All @@ -31,7 +32,11 @@ def __init__(self, args):
self.logger.info("ProgressInfo:0.0%")

def run(self):
trg = '%s/../../../output/%s/%s.shp' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id, dst)
output_dir = '/tmp/%s' % self.args.execution_id
if not os.path.exists(output_dir):
os.makedirs(output_dir)
# trg = '%s/../../../output/%s/%s.shp' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id, dst)
trg = '%s/%s.shp' % (output_dir, dst)

# fullCmd = ' '.join([gdalContour, cmd, self.youCanQuoteMe(src), \
# self.youCanQuoteMe(dst), interval, self.args.interval])
Expand All @@ -56,7 +61,7 @@ def run(self):
if (ret == 0):
# zipf = zipfile.ZipFile(self.args.workdir+'/contour.zip', 'w')
# self.zipdir(self.args.workdir+'/', zipf)
output_dir = '%s/../../../output/%s' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id)
# output_dir = '%s/../../../output/%s' % (os.path.dirname(os.path.abspath(__file__)), self.args.execution_id)
zipf = zipfile.ZipFile(output_dir+'/contour.zip', 'w')
self.zipdir(output_dir+'/', zipf)
zipf.close()
Expand Down
3 changes: 2 additions & 1 deletion src/wpsremote/xmpp_data/configs/myservice/service.config
Expand Up @@ -17,7 +17,8 @@ namespace = default
description = GDAL Contour Remote Service
executable_path = ./xmpp_data/configs/myservice/code
executable_cmd = python %(executable_path)s/test.py
output_dir = ./xmpp_data/output/
# output_dir = ./xmpp_data/output/
output_dir = /tmp
unique_execution_id = %(unique_exe_id)s
workdir = %(output_dir)s/%(unique_execution_id)s
active = True
Expand Down

0 comments on commit 9999b4c

Please sign in to comment.