Skip to content

Commit

Permalink
Changed group_start and group_end functions to support booleans, inte…
Browse files Browse the repository at this point in the history
…gers and strings
  • Loading branch information
awicenec committed Jul 14, 2021
1 parent 11b7aeb commit 28dd07c
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions daliuge-translator/dlg/dropmake/pg_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,32 @@ def is_start_listener(self):
)

def is_group_start(self):
return (
self.has_group()
and "group_start" in self.jd
and 1 == int(self.jd["group_start"])
)
result = False
if self.has_group() \
and "group_start" in self.jd:
gs = self.jd["group_start"]
if type(gs) == type(True):
result = gs
elif type(gs == type(1)):
result = (1 == gs)
elif type(gs) == type("s"):
result = gs.lower() in ("true")
return result

def is_group_end(self):
return (
self.has_group()
and "group_end" in self.jd
and 1 == int(self.jd["group_end"])
)

def is_group_end(self):
result = False
if self.has_group() \
and "group_end" in self.jd:
ge = self.jd["group_end"]
if type(ge) == type(True):
result = ge
elif type(ge == type(1)):
result = (1 == ge)
elif type(ge) == type("s"):
result = ge.lower() in ("true")
return result

def is_group(self):
return self._isgrp

Expand Down

0 comments on commit 28dd07c

Please sign in to comment.