From 6a51c153b70ad95d81fc70dcb63697073dea1a94 Mon Sep 17 00:00:00 2001 From: Stepland <16676308+Stepland@users.noreply.github.com> Date: Sat, 1 May 2021 13:58:53 +0200 Subject: [PATCH] Add blank lines between blocks in #memo2 rendering --- CHANGELOG.md | 1 + jubeatools/formats/jubeat_analyser/memo2/dump.py | 7 +++++-- jubeatools/formats/memon/__init__.py | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 065f951..70abde0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - jubeat analyser : Use "EXT" instead of "?" as the fallback difficulty name when loading ## Fixed - memon : Fix TypeError that would occur when trying to convert to memon +- #memo2 : Fix #memo2 rendering missing blank lines between blocks, while technically still valid files, this made #memo2 files rendered by jubeatools absolutely fugly and very NOT human friendly # v0.1.2 ## Fixed diff --git a/jubeatools/formats/jubeat_analyser/memo2/dump.py b/jubeatools/formats/jubeat_analyser/memo2/dump.py index 3a4b68b..32efab9 100644 --- a/jubeatools/formats/jubeat_analyser/memo2/dump.py +++ b/jubeatools/formats/jubeat_analyser/memo2/dump.py @@ -328,9 +328,12 @@ def _dump_memo2_chart( file.write(dump_command("memo2") + "\n") + file.write("\n") + # Notes - for _, section in sections.items(): - file.write(section.render(circle_free) + "\n") + file.write( + "\n\n".join(section.render(circle_free) for _, section in sections.items()) + ) return file diff --git a/jubeatools/formats/memon/__init__.py b/jubeatools/formats/memon/__init__.py index eb606df..294c844 100644 --- a/jubeatools/formats/memon/__init__.py +++ b/jubeatools/formats/memon/__init__.py @@ -274,9 +274,7 @@ def _raise_if_unfit_for_v0(song: Song, version: str) -> None: raise ValueError("The song has no timing information") chart_timings = [ - chart.timing - for chart in song.charts.values() - if chart.timing is not None + chart.timing for chart in song.charts.values() if chart.timing is not None ] if chart_timings: