Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/geoserver/wps-remote
Browse files Browse the repository at this point in the history
# Conflicts:
#	.travis.yml
#	requirements.txt
  • Loading branch information
afabiani committed Oct 22, 2019
2 parents 32983a8 + 5895808 commit 4ccf7c2
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 19 deletions.
19 changes: 11 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
sudo: false
cache:
directories:
- "$HOME"
language: python
python:
- 2.7
matrix:
include:
- python: 2.7.8
dist: precise
before_install: pip install --upgrade pip setuptools
- python: 2.7
- python: 3.7
allow_failures:
- python: 3.7
install:
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then travis_retry pip install -r requirements.txt ; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then travis_retry pip install coveralls ; fi
- travis_retry pip install coveralls -r requirements.txt
script:
- flake8 .
- python setup.py test
- coverage run --source=src setup.py test
after_success: coveralls
Expand Down
11 changes: 3 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
asn1crypto==0.24.0
astroid==1.4.4
autopep8==1.4.3
bcrypt==3.1.4
bleach==3.1.0
Expand All @@ -11,29 +10,25 @@ coverage==4.5.4
cryptography==2.3.1
docutils==0.15.2
enum34==1.1.6
flake8==2.5.4
flake8==3.7.8
functools32==3.2.3.post2
idna==2.7
ipaddress==1.0.22
jsonschema==2.5.1
lazy-object-proxy==1.2.1
mccabe==0.4.0
paramiko==2.4.1
pep8==1.7.1
paramiko==2.4.2
pkginfo==1.5.0.1
psutil==5.4.7
pyasn1==0.4.4
pycodestyle==2.4.0
pycparser==2.18
pycrypto==2.6.1
pyflakes==1.0.0
Pygments==2.4.2
pylint==1.5.4
PyNaCl==1.2.1
readme-renderer==24.0
requests==2.22.0
requests-toolbelt==0.9.1
six==1.10.0
six==1.12.0
sleekxmpp==1.3.3
tqdm==4.36.1
twine==1.15.0
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description-file = README.md
[flake8]
max-line-length = 120
exclude=management,scripts,docs,static
ignore=E121,E122,E124,E126,E226
ignore=E121,E122,E124,E126,E226,W504
1 change: 0 additions & 1 deletion src/wpsremote/resource_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# This code is licensed under the GPL 2.0 license, available at the root
# application directory.

import time
import psutil
import logging
import threading
Expand Down
3 changes: 2 additions & 1 deletion src/wpsremote/servicebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ def output_parser_verbose(self, invoked_process, param_filepath):
self.bus.SendMessage(busIndipendentMessages.
ErrorMessage(exe_msg.originator(),
msg +
" Exception: remote process exception. Please check outputs!",
(" Exception: remote process exception. "
"Please check outputs!"),
exe_msg.UniqueId()))
except BaseException:
pass
Expand Down
50 changes: 50 additions & 0 deletions src/wpsremote/xmpp_data/configs/myservice/code/test_xml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import logging.config
import logging
import argparse
import sys
import os


class Greetings(object):

def __init__(self, args):
self.args = args
self.create_logger("logger_test.properties")
self.logger.info("ProgressInfo:0.0%")

def run(self):
try:
trg = '%s/../../../output/%s/greetings.xml' % (os.path.dirname(
os.path.abspath(__file__)), self.args.execution_id)
file = open(trg, "w")
file.write("<greeting>Hello, %s</greeting>" % self.args.theName)
file.close()

ret = 0
self.logger.info("ProgressInfo:100%")
except:
ret = -1
self.logger.critical("Error occurred during processing.")

return ret

def create_logger(self, logger_config_file):
defaults = {}

logging.config.fileConfig(str(logger_config_file), defaults=defaults)

self.logger = logging.getLogger("main.create_logger")

self.logger.debug("Logger initialized with file " + str(logger_config_file))


if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--theName", nargs='?', default="Alessio", help="The Name.")
parser.add_argument("-w", "--workdir", nargs='?', default="", help="Remote process sandbox working directory.")
parser.add_argument("-e", "--execution_id", nargs='?', default="", help="Remote process Unique Execution Id.")
cmdargs = parser.parse_args()

greeting = Greetings(cmdargs)
return_code = greeting.run()
sys.exit(return_code)

0 comments on commit 4ccf7c2

Please sign in to comment.