Skip to content

Commit

Permalink
Update PrettyJson.py
Browse files Browse the repository at this point in the history
Remove print statements
  • Loading branch information
TerminalFi authored Jun 12, 2021
1 parent 34c27bc commit 6516ce7
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions PrettyJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,18 @@ def json_dumps(obj, minified: bool = False) -> str:
items = [a.strip() for a in content.split(os.linesep)]
items = [item[:-1] if item[-1] == "," else item for item in items]
replacement = "["
print(items)
for index, item in enumerate(items):
if item in ('{', '}'):
replacement = replacement + item
if item == '}':
if index!= len(items)-1:
print(items.index(item))
print(len(items)-1)
replacement = replacement + ','
else:
replacement = replacement + item
if index != len(items)-1:
if items[items.index(item)+1] != '}':
replacement = replacement + ','
replacement = replacement + ']'
print(replacement)

if len(replacement) <= settings.get("max_arrays_line_length", 120):
output_json = output_json.replace(m, replacement, 1)
Expand Down

0 comments on commit 6516ce7

Please sign in to comment.