FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ews-coordinator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gilligan Lab for Epidemiology and Modelling
Wheat rusts
ews-coordinator
Commits
b3f4c621
Commit
b3f4c621
authored
6 months ago
by
L. Bower
Browse files
Options
Downloads
Patches
Plain Diff
updating comments
parent
8e6db619
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ews/coordinator/utils/jobstatus.py
+2
-2
2 additions, 2 deletions
ews/coordinator/utils/jobstatus.py
ews/coordinator/utils/processor_utils.py
+11
-0
11 additions, 0 deletions
ews/coordinator/utils/processor_utils.py
with
13 additions
and
2 deletions
ews/coordinator/utils/jobstatus.py
+
2
−
2
View file @
b3f4c621
...
@@ -12,8 +12,8 @@ class Jobstatus:
...
@@ -12,8 +12,8 @@ class Jobstatus:
Context manager to determine and change status of a job based on status file
Context manager to determine and change status of a job based on status file
in a given directory.
in a given directory.
Only possible status values are
'
SUCCESS
'
,
'
INPROGRESS
'
,
'
HELD
'
,
'
WARNING
'
Only possible status values are
'
SUCCESS
'
,
'
INPROGRESS
'
,
'
HELD
'
,
'
WARNING
'
,
and
'
ERROR
'
.
'
SUCCESS_WITH_WARNING
'
,
'
SUCCESS_WITH_ERROR
'
and
'
ERROR
'
.
Use jobStatus.reset(status) to change the current status file.
Use jobStatus.reset(status) to change the current status file.
...
...
This diff is collapsed.
Click to expand it.
ews/coordinator/utils/processor_utils.py
+
11
−
0
View file @
b3f4c621
...
@@ -127,6 +127,17 @@ def open_and_check_config(configFile) -> dict:
...
@@ -127,6 +127,17 @@ def open_and_check_config(configFile) -> dict:
def
parse_json_file_with_tokens
(
file_path
:
str
,
tokens
:
dict
=
None
)
->
dict
:
def
parse_json_file_with_tokens
(
file_path
:
str
,
tokens
:
dict
=
None
)
->
dict
:
"""
parses a json file, replacing any tokens with values from the tokens dict. Tokens are marked as ${token_name} in the
json file. The tokens dict should be a dictionary of key value pairs where the key is the token and the value is the
value to replace the token with. This function can be called with None for the tokens argument, resulting in a simple
json file parse.
:param file_path:
:param tokens:
:return:
"""
with
open
(
file_path
,
'
r
'
)
as
file
:
with
open
(
file_path
,
'
r
'
)
as
file
:
file_string
:
str
=
file
.
read
()
file_string
:
str
=
file
.
read
()
file
.
seek
(
0
)
# reset the index to read again
file
.
seek
(
0
)
# reset the index to read again
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment