From 2e7fb134abf4a819ab1a8440e3d156ce80ee9fa4 Mon Sep 17 00:00:00 2001 From: parallax Date: Mon, 22 Aug 2016 18:11:59 +0100 Subject: [PATCH 1/4] Added some verbosity to the error message in case of missing packages --- chatops/python/gitlab-to-pentext.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/chatops/python/gitlab-to-pentext.py b/chatops/python/gitlab-to-pentext.py index a44f10f..020b178 100644 --- a/chatops/python/gitlab-to-pentext.py +++ b/chatops/python/gitlab-to-pentext.py @@ -33,12 +33,16 @@ import textwrap try: import gitlab import jxmlease - # path to docbuilder installation (needs the module) - sys.path.append('/usr/local/bin') + # Path of this script. The validate_report module is on the same path. import validate_report -except ImportError: - print('[-] This script needs gitlab, jxmlease and validate_report library', - file=sys.stderr) +except ImportError as e: + print('[-] This script needs python-gitlab, jxmlease and validate_report library', file=sys.stderr) + print("validate_report is part of the pentext framework", file=sys.stderr) + print("Install python-gitlab with: sudo pip install python-gitlab", file=sys.stderr) + print("Install pjxmlease with: sudo pip install jxmlease", file=sys.stderr) + print("", file=sys.stderr) + print("Currently missing: " + e.message,file=sys.stderr) + sys.exit(-1) From 53c5dd38acc13c2ad4365e81b1e9fc77289f30c5 Mon Sep 17 00:00:00 2001 From: parallax Date: Mon, 22 Aug 2016 18:18:46 +0100 Subject: [PATCH 2/4] Added required line --- chatops/python/gitlab-to-pentext.py | 1 + 1 file changed, 1 insertion(+) diff --git a/chatops/python/gitlab-to-pentext.py b/chatops/python/gitlab-to-pentext.py index 020b178..0e42b22 100644 --- a/chatops/python/gitlab-to-pentext.py +++ b/chatops/python/gitlab-to-pentext.py @@ -34,6 +34,7 @@ try: import gitlab import jxmlease # Path of this script. The validate_report module is on the same path. + sys.path.append(os.path.dirname(__file__)) import validate_report except ImportError as e: print('[-] This script needs python-gitlab, jxmlease and validate_report library', file=sys.stderr) From 073ec455198b9831744b9861a5d07e1dd48443d5 Mon Sep 17 00:00:00 2001 From: parallax Date: Thu, 8 Sep 2016 13:31:14 +0100 Subject: [PATCH 3/4] Expanded rosbot's usage docs --- chatops/scripts/rosbot.coffee | 46 ++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/chatops/scripts/rosbot.coffee b/chatops/scripts/rosbot.coffee index 2dc342f..30eba0b 100644 --- a/chatops/scripts/rosbot.coffee +++ b/chatops/scripts/rosbot.coffee @@ -9,18 +9,46 @@ # # Usage: # build -# Detailed line 1 -# Detailed line 2 -# Detailed line 3 +# Builds a .pdf document of based on files in . The file is stored in target/ of the specified repository. +# Usage: build [namespace=ros] [branch=master] [-v] +# Can be either report or quote +# Specifies the name of the gitlab repository where the files needed to do the job are located. +# [namespace] This optional parameter refers to the gitlab user or group this repository is part of. Defaults to ros +# [branch] This optional parameter specifies which branch to use. Defaults to master. +# [-v] Specifying this flag will yield verbose output. +# +# convert +# Converts gitlab issues in to xml files. The issues must be open and need to be labelled with either finding or non-finding. +# Depending on the label, the xml files will be put in either the finding/ or non-finding/ directory in the repository. +# Usage: convert [--closed] [--dry-run] [--issues] [--projects] [-v|--verbose] [-y] +# Specifies the name of the gitlab repository where the files needed to do the job are located. +# [--closed] If specified, will include closed issues +# [--dry-run] If specified, will not write xml files, but only displays output on screen +# [--issues] If specified, will list issues in given +# [--projects] If specified, will list gitlab repositories +# [-v|--verbose] If specified, will yield verbose output +# [-y] Assumes yes on all questions # -# respond -# Detailed line 11 -# Detailed line 22 -# Detailed line 33 +# validate +# Validates the XML structure of a reports or quote to be able to generate a .pdf file. (See build command) +# Usage: validate [-a|-all] [--autofix] [-c|--capitalization] [--debug] [--edit] [--learn] [--long] [--offer] [--spelling] [-v|--verbose] [--no-report] [--quiet] +# Specifies the name of the gitlab repository where the files needed to do the job are located. +# [-a|-all] Perform all checks +# [--autofix] Try to automatically correct issues +# [-c|--capitalization] Check capitalization +# [--debug] Show debug information +# [--edit] Open files with issues using an editor +# [--learn] Store all unknown words in dictionary file +# [--long] Check for long lines +# [--offer] Validate offer master file +# [--spelling] Check spelling +# [-v|--verbose] If specified, will yield verbose output +# [--no-report] Do not validate report master file +# [--quiet] Don't output status messages # # # Commands: -# hubot build - Builds a .pdf file from in +# hubot build - Builds a .pdf file from in # hubot convert - Builds a .xml file from in # hubot invoice - Builds pdf invoice from quote # hubot quickscope [branch=MASTER] - Converts quickscope into quotation @@ -240,4 +268,4 @@ module.exports = (robot) -> # All odd case have been dealt with, let's get down to business for index, line of robot.usages[command] - msg.send line \ No newline at end of file + msg.send line From 7029ed422a1f84e7fff2548203b6a669883e92e4 Mon Sep 17 00:00:00 2001 From: parallax Date: Thu, 8 Sep 2016 13:37:33 +0100 Subject: [PATCH 4/4] Fixed typo --- chatops/python/gitlab-to-pentext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatops/python/gitlab-to-pentext.py b/chatops/python/gitlab-to-pentext.py index 0e42b22..1f9fe26 100644 --- a/chatops/python/gitlab-to-pentext.py +++ b/chatops/python/gitlab-to-pentext.py @@ -40,7 +40,7 @@ except ImportError as e: print('[-] This script needs python-gitlab, jxmlease and validate_report library', file=sys.stderr) print("validate_report is part of the pentext framework", file=sys.stderr) print("Install python-gitlab with: sudo pip install python-gitlab", file=sys.stderr) - print("Install pjxmlease with: sudo pip install jxmlease", file=sys.stderr) + print("Install jxmlease with: sudo pip install jxmlease", file=sys.stderr) print("", file=sys.stderr) print("Currently missing: " + e.message,file=sys.stderr)