Skip to content

Commit

Permalink
CleanJSON.py: add samples on the output header and footer as heredoc
Browse files Browse the repository at this point in the history
  • Loading branch information
medicalwei committed Jun 25, 2024
1 parent ed92e0e commit 7ec6532
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CleanJSON.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ def run(self):
self.save()

def make_header(self):
"""
{
"localeCode": "en",
"authors": ["author1", "author2", ],
"messages": {
"""
self.output.append("{")
self.output.append(' "localeCode": "{}",'.format(self.lang["localeCode"]))
self.output.append(
Expand All @@ -28,6 +34,11 @@ def make_header(self):
self.output.append(' "messages": {')

def make_footer(self):
"""
"Dummy": "Dummy"
}
}
"""
self.output.append(' "Dummy": "Dummy"')
self.output.append(" }")
self.output.append("}")
Expand Down

0 comments on commit 7ec6532

Please sign in to comment.