Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
10b31454
Commit
10b31454
authored
7 years ago
by
Auke Klazema
Browse files
Options
Downloads
Patches
Plain Diff
Task #9893: TriggerEmailService was not aware of the new dwelling time parameters
parent
0e6980a9
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TriggerEmailService/Server/lib/TriggerEmailService.py
+19
-7
19 additions, 7 deletions
SAS/TriggerEmailService/Server/lib/TriggerEmailService.py
SAS/TriggerEmailService/Server/test/t_TriggerEmailService.py
+541
-3
541 additions, 3 deletions
SAS/TriggerEmailService/Server/test/t_TriggerEmailService.py
with
560 additions
and
10 deletions
SAS/TriggerEmailService/Server/lib/TriggerEmailService.py
+
19
−
7
View file @
10b31454
...
...
@@ -239,18 +239,30 @@ class TriggerNotificationListener(AbstractBusListener):
start_times
=
doc
.
getroot
().
findall
(
'
specification/activity/observation/timeWindowSpecification/startTime
'
)
start_time
=
datetime
.
strptime
(
start_times
[
0
].
text
,
'
%Y-%m-%dT%H:%M:%S
'
)
if
start_times
:
# Not dwelling
start_time
=
datetime
.
strptime
(
start_times
[
0
].
text
,
'
%Y-%m-%dT%H:%M:%S
'
)
durations
=
doc
.
getroot
().
findall
(
'
specification/activity/observation/timeWindowSpecification/duration/duration
'
)
durations
=
doc
.
getroot
().
findall
(
'
specification/activity/observation/timeWindowSpecification/duration/duration
'
)
duration
=
durations
[
0
].
text
duration
=
durations
[
0
].
text
duration_seconds
=
self
.
_iso8601_duration_as_seconds
(
duration
)
duration_seconds
=
self
.
_iso8601_duration_as_seconds
(
duration
)
stop_time
=
start_time
+
timedelta
(
seconds
=
duration_seconds
)
stop_time
=
start_time
+
timedelta
(
seconds
=
duration_seconds
)
return
start_time
,
stop_time
else
:
# Dwelling
min_start_times
=
doc
.
getroot
().
findall
(
'
specification/activity/observation/timeWindowSpecification/minStartTime
'
)
min_start_time
=
datetime
.
strptime
(
min_start_times
[
0
].
text
,
'
%Y-%m-%dT%H:%M:%S
'
)
max_end_times
=
doc
.
getroot
().
findall
(
'
specification/activity/observation/timeWindowSpecification/maxEndTime
'
)
max_end_time
=
datetime
.
strptime
(
max_end_times
[
0
].
text
,
'
%Y-%m-%dT%H:%M:%S
'
)
return
min_start_time
,
max_end_time
return
start_time
,
stop_time
def
start_listening
(
self
,
**
kwargs
):
self
.
mom_rpc_client
.
open
()
...
...
This diff is collapsed.
Click to expand it.
SAS/TriggerEmailService/Server/test/t_TriggerEmailService.py
+
541
−
3
View file @
10b31454
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