Skip to content

Commit

Permalink
Fixes issue dixudx#124.
Browse files Browse the repository at this point in the history
`tox pep8,py27,py36` now passes.
  • Loading branch information
adam-fineman committed Feb 2, 2020
1 parent 1721dd0 commit 4ef126c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions rtcclient/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,18 +351,22 @@ def _remove_long_fields(self, wk_raw_data):

match_str_list = ["rtc_cm:com.ibm.",
"calm:"]
to_delete = []
for key in wk_raw_data.keys():
for match_str in match_str_list:
if key.startswith(match_str):
try:
wk_raw_data.pop(key)
self.log.debug("Successfully remove field [%s] from "
"the template", key)
except:
self.log.warning("Cannot remove field [%s] from the "
"template", key)
to_delete.append(key)
continue

for key in to_delete:
try:
del wk_raw_data[key]
self.log.debug("Successfully removed field [%s] from "
"the template", key)
except:
self.log.warning("Cannot remove field [%s] from the "
"template", key)

def getTemplates(self, workitems, template_folder=None,
template_names=None, keep=False, encoding="UTF-8"):
"""Get templates from a group of to-be-copied :class:`Workitems` and
Expand Down

0 comments on commit 4ef126c

Please sign in to comment.