Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows empty lines in RPP files #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rpp/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def token(self):
def __iter__(self):
lines = self._input.splitlines()
for lineno, line in enumerate(lines, start=1):
if not line.strip():
continue
is_first_token_in_line = True
while line:
line = line.strip()
Expand Down
107 changes: 107 additions & 0 deletions tests/data/with_empty_lines.RPP
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<REAPER_PROJECT 0.1 "5.979" 1563117669
RIPPLE 0
GROUPOVERRIDE 0 0 0
AUTOXFADE 1
ENVATTACH 1
POOLEDENVATTACH 0
MIXERUIFLAGS 11 48
PEAKGAIN 1
FEEDBACK 0
PANLAW 1
PROJOFFS 0 0 0
MAXPROJLEN 0 600
GRID 3199 8 1 8 1 0 0 0
TIMEMODE 1 5 -1 30 0
VIDEO_CONFIG 0 0 256
PANMODE 3
CURSOR 0
ZOOM 100 0 0
VZOOMEX 6
USE_REC_CFG 2
RECMODE 1
SMPTESYNC 0 30 100 40 1000 300 0 0 1 0 0
LOOP 0
LOOPGRAN 0 4
RECORD_PATH "AudioFiles" ""
<RECORD_CFG
Y2FsZhgAAAAIAAAA
>
<APPLYFX_CFG
>
RENDER_FILE ""
RENDER_PATTERN ""
RENDER_FMT 0 2 0
RENDER_1X 0
RENDER_RANGE 1 0 0 18 1000
RENDER_RESAMPLE 3 0 1
RENDER_ADDTOPROJ 0
RENDER_STEMS 0
RENDER_DITHER 0
TIMELOCKMODE 1
TEMPOENVLOCKMODE 1
ITEMMIX 0
DEFPITCHMODE 589824 0
TAKELANE 1
SAMPLERATE 48000 1 0
<RENDER_CFG
Y2FsZhgAAAAIAAAA
>
LOCK 1
<METRONOME 22 1
VOL 0.25 0.125
FREQ 1000 500 1
BEATLEN 50
SAMPLES "" ""
PATTERN 2863311530 2863311529
>
GLOBAL_AUTO -1
TEMPO 120 4 4
PLAYRATE 1 0 0.25 4
SELECTION 0 0
SELECTION2 0 0
MASTERAUTOMODE 0
MASTERTRACKHEIGHT 0 0
MASTERPEAKCOL 16576
MASTERMUTESOLO 0
MASTERTRACKVIEW 0 0.6667 0.5 0.5 0 0 0
MASTERHWOUT 0 0 1 0 0 0 0 -1
MASTER_NCH 2 2
MASTER_VOLUME 1 0 -1 -1 1
MASTER_FX 1
MASTER_SEL 0
<MASTERPLAYSPEEDENV
ACT 0 -1
VIS 0 1 1
LANEHEIGHT 0 0
ARM 0
DEFSHAPE 0 -1 -1
>
<TEMPOENVEX
ACT 1 -1
VIS 1 0 1
LANEHEIGHT 0 0
ARM 0
DEFSHAPE 1 -1 -1
>
<PROJBAY
>
<EXTENSIONS
<MCU_KLINKE
|#{PROJECT_CONFIG/}#|

>
<MCU_B_KLINKE
|#{PROJECT_CONFIG}#|
|#{TRACKSTATES/}#|
|#{PLUGMAPMANAGER/}#|
|#{PLUGACCESS}#|
|#{SELECTED_PLUG track="{00000000-0000-0000-0000-000000000000}" slot="-1"/}#|
|#{/PLUGACCESS}#|
|#{PLUGPRESETMANAGER/}#|
|#{PLUGMODE/}#|
|#{LAST_CALLED_PRESETS/}#|
|#{/PROJECT_CONFIG}#|

>
>
>
1 change: 1 addition & 0 deletions tests/test_rpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def test_dumps():
@pytest.mark.parametrize('filename', [
'empty.RPP',
'vst.RPP',
# 'with_empty_lines.RPP', # left out ATM, due to empty lines / indentations
])
def test_conversion(filename):
DIR = path.dirname(__file__)
Expand Down