pyrekordbox 0.3.1__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyrekordbox/__init__.py +8 -8
- pyrekordbox/__main__.py +3 -2
- pyrekordbox/_version.py +2 -2
- pyrekordbox/anlz/__init__.py +3 -2
- pyrekordbox/anlz/file.py +4 -2
- pyrekordbox/anlz/tags.py +3 -1
- pyrekordbox/config.py +79 -23
- pyrekordbox/db6/__init__.py +2 -2
- pyrekordbox/db6/aux_files.py +3 -2
- pyrekordbox/db6/database.py +227 -143
- pyrekordbox/db6/registry.py +1 -0
- pyrekordbox/db6/smartlist.py +375 -0
- pyrekordbox/db6/tables.py +81 -20
- pyrekordbox/logger.py +0 -1
- pyrekordbox/mysettings/__init__.py +5 -4
- pyrekordbox/mysettings/file.py +3 -1
- pyrekordbox/rbxml.py +5 -3
- pyrekordbox/utils.py +4 -3
- {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/LICENSE +1 -1
- {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/METADATA +26 -42
- pyrekordbox-0.4.0.dist-info/RECORD +25 -0
- {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/WHEEL +1 -1
- {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/top_level.txt +0 -2
- docs/Makefile +0 -20
- docs/make.bat +0 -35
- docs/source/_static/images/anlz_beat.svg +0 -53
- docs/source/_static/images/anlz_file.svg +0 -204
- docs/source/_static/images/anlz_pco2.svg +0 -138
- docs/source/_static/images/anlz_pcob.svg +0 -148
- docs/source/_static/images/anlz_pcp2.svg +0 -398
- docs/source/_static/images/anlz_pcpt.svg +0 -263
- docs/source/_static/images/anlz_ppth.svg +0 -123
- docs/source/_static/images/anlz_pqt2.svg +0 -324
- docs/source/_static/images/anlz_pqt2_2.svg +0 -253
- docs/source/_static/images/anlz_pqtz.svg +0 -140
- docs/source/_static/images/anlz_pssi.svg +0 -192
- docs/source/_static/images/anlz_pssi_entry.svg +0 -191
- docs/source/_static/images/anlz_pvbr.svg +0 -125
- docs/source/_static/images/anlz_pwav.svg +0 -130
- docs/source/_static/images/anlz_pwv3.svg +0 -139
- docs/source/_static/images/anlz_pwv4.svg +0 -139
- docs/source/_static/images/anlz_pwv5.svg +0 -139
- docs/source/_static/images/anlz_pwv5_entry.svg +0 -100
- docs/source/_static/images/anlz_pwv6.svg +0 -130
- docs/source/_static/images/anlz_pwv7.svg +0 -139
- docs/source/_static/images/anlz_pwvc.svg +0 -125
- docs/source/_static/images/anlz_tag.svg +0 -110
- docs/source/_static/images/x64dbg_rb_key.png +0 -0
- docs/source/_static/logos/dark/logo_primary.svg +0 -75
- docs/source/_static/logos/light/logo_primary.svg +0 -75
- docs/source/_static/logos/mid/logo_primary.svg +0 -75
- docs/source/_templates/apidoc/module.rst_t +0 -8
- docs/source/_templates/apidoc/package.rst_t +0 -57
- docs/source/_templates/apidoc/toc.rst_t +0 -7
- docs/source/_templates/autosummary/class.rst +0 -32
- docs/source/_templates/autosummary/module.rst +0 -55
- docs/source/api.md +0 -18
- docs/source/conf.py +0 -178
- docs/source/development/changes.md +0 -3
- docs/source/development/contributing.md +0 -3
- docs/source/formats/anlz.md +0 -634
- docs/source/formats/db6.md +0 -1233
- docs/source/formats/mysetting.md +0 -392
- docs/source/formats/xml.md +0 -376
- docs/source/index.md +0 -103
- docs/source/installation.md +0 -271
- docs/source/key.md +0 -103
- docs/source/quickstart.md +0 -185
- docs/source/requirements.txt +0 -7
- docs/source/tutorial/anlz.md +0 -7
- docs/source/tutorial/configuration.md +0 -66
- docs/source/tutorial/db6.md +0 -178
- docs/source/tutorial/index.md +0 -20
- docs/source/tutorial/mysetting.md +0 -124
- docs/source/tutorial/xml.md +0 -140
- pyrekordbox/db6/smart_playlist.py +0 -333
- pyrekordbox/xml.py +0 -8
- pyrekordbox-0.3.1.dist-info/RECORD +0 -84
- tests/__init__.py +0 -3
- tests/test_anlz.py +0 -206
- tests/test_config.py +0 -175
- tests/test_db6.py +0 -1115
- tests/test_mysetting.py +0 -203
- tests/test_xml.py +0 -629
tests/test_mysetting.py
DELETED
@@ -1,203 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Author: Dylan Jones
|
3
|
-
# Date: 2022-10-25
|
4
|
-
|
5
|
-
import os
|
6
|
-
import pytest
|
7
|
-
from pyrekordbox.mysettings import (
|
8
|
-
read_mysetting_file,
|
9
|
-
MySettingFile,
|
10
|
-
MySetting2File,
|
11
|
-
DjmMySettingFile,
|
12
|
-
)
|
13
|
-
from pyrekordbox.mysettings.file import compute_checksum
|
14
|
-
|
15
|
-
TEST_ROOT = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".testdata")
|
16
|
-
|
17
|
-
MYSETTING_KEYS = [
|
18
|
-
"on_air_display",
|
19
|
-
"lcd_brightness",
|
20
|
-
"quantize",
|
21
|
-
"auto_cue_level",
|
22
|
-
"language",
|
23
|
-
"jog_ring_brightness",
|
24
|
-
"jog_ring_indicator",
|
25
|
-
"slip_flashing",
|
26
|
-
"eject_lock",
|
27
|
-
"disc_slot_illumination",
|
28
|
-
"sync",
|
29
|
-
"play_mode",
|
30
|
-
"quantize_beat_value",
|
31
|
-
"hotcue_autoload",
|
32
|
-
"hotcue_color",
|
33
|
-
"needle_lock",
|
34
|
-
"time_mode",
|
35
|
-
"jog_mode",
|
36
|
-
"auto_cue",
|
37
|
-
"master_tempo",
|
38
|
-
"tempo_range",
|
39
|
-
"phase_meter",
|
40
|
-
]
|
41
|
-
|
42
|
-
MYSETTING2_KEYS = [
|
43
|
-
"vinyl_speed_adjust",
|
44
|
-
"jog_display_mode",
|
45
|
-
"pad_button_brightness",
|
46
|
-
"jog_lcd_brightness",
|
47
|
-
"waveform_divisions",
|
48
|
-
"waveform",
|
49
|
-
"beat_jump_beat_value",
|
50
|
-
]
|
51
|
-
|
52
|
-
DJMMYSETTING_KEYS = [
|
53
|
-
"channel_fader_curve",
|
54
|
-
"cross_fader_curve",
|
55
|
-
"headphones_pre_eq",
|
56
|
-
"headphones_mono_split",
|
57
|
-
"beat_fx_quantize",
|
58
|
-
"mic_low_cut",
|
59
|
-
"talk_over_mode",
|
60
|
-
"talk_over_level",
|
61
|
-
"midi_channel",
|
62
|
-
"midi_button_type",
|
63
|
-
"display_brightness",
|
64
|
-
"indicator_brightness",
|
65
|
-
"channel_fader_curve_long",
|
66
|
-
]
|
67
|
-
|
68
|
-
|
69
|
-
def _read_setting_file(type_, key, value):
|
70
|
-
file = type_.upper() + ".DAT"
|
71
|
-
root = os.path.join(TEST_ROOT, "mysettings", type_)
|
72
|
-
path = os.path.join(root, key, value, file)
|
73
|
-
if not os.path.exists(path):
|
74
|
-
raise FileNotFoundError(path)
|
75
|
-
return read_mysetting_file(path)
|
76
|
-
|
77
|
-
|
78
|
-
def _read_default_setting_file(type_):
|
79
|
-
file = type_.upper() + ".DAT"
|
80
|
-
root = os.path.join(TEST_ROOT, "mysettings")
|
81
|
-
path = os.path.join(root, file)
|
82
|
-
if not os.path.exists(path):
|
83
|
-
raise FileNotFoundError(path)
|
84
|
-
return read_mysetting_file(path)
|
85
|
-
|
86
|
-
|
87
|
-
def _get_values(type_, key):
|
88
|
-
root = os.path.join(TEST_ROOT, "mysettings", type_, key)
|
89
|
-
return os.listdir(root)
|
90
|
-
|
91
|
-
|
92
|
-
# -- MySetting -------------------------------------------------------------------------
|
93
|
-
|
94
|
-
|
95
|
-
@pytest.mark.parametrize("key", MYSETTING_KEYS)
|
96
|
-
def test_get_mysetting(key):
|
97
|
-
for expected in _get_values("mysetting", key):
|
98
|
-
file = _read_setting_file("mysetting", key, expected)
|
99
|
-
assert file[key] == expected
|
100
|
-
|
101
|
-
|
102
|
-
def test_mysetting_defaults():
|
103
|
-
file_default = _read_default_setting_file("mysetting")
|
104
|
-
file = MySettingFile()
|
105
|
-
for key in MYSETTING_KEYS:
|
106
|
-
assert file[key] == file_default[key]
|
107
|
-
|
108
|
-
|
109
|
-
@pytest.mark.parametrize("key", MYSETTING_KEYS)
|
110
|
-
def test_set_mysetting(key):
|
111
|
-
type_ = "mysetting"
|
112
|
-
for val in _get_values(type_, key):
|
113
|
-
# Read value file
|
114
|
-
file_ref = _read_setting_file(type_, key, val)
|
115
|
-
# Read default file and update value
|
116
|
-
file = _read_default_setting_file(type_)
|
117
|
-
file[key] = val
|
118
|
-
# Check values are identical
|
119
|
-
assert file[key] == file_ref[key]
|
120
|
-
# Check binary data is identical
|
121
|
-
assert file.build() == file_ref.build()
|
122
|
-
|
123
|
-
|
124
|
-
# -- MySetting2 ------------------------------------------------------------------------
|
125
|
-
|
126
|
-
|
127
|
-
@pytest.mark.parametrize("key", MYSETTING2_KEYS)
|
128
|
-
def test_get_mysetting2(key):
|
129
|
-
for expected in _get_values("mysetting2", key):
|
130
|
-
file = _read_setting_file("mysetting2", key, expected)
|
131
|
-
assert file[key] == expected
|
132
|
-
|
133
|
-
|
134
|
-
def test_mysetting2_defaults():
|
135
|
-
file_default = _read_default_setting_file("mysetting2")
|
136
|
-
file = MySetting2File()
|
137
|
-
for key in MYSETTING2_KEYS:
|
138
|
-
assert file[key] == file_default[key]
|
139
|
-
|
140
|
-
|
141
|
-
@pytest.mark.parametrize("key", MYSETTING2_KEYS)
|
142
|
-
def test_set_mysetting2(key):
|
143
|
-
type_ = "mysetting2"
|
144
|
-
for val in _get_values(type_, key):
|
145
|
-
# Read value file
|
146
|
-
file_ref = _read_setting_file(type_, key, val)
|
147
|
-
# Read default file and update value
|
148
|
-
file = _read_default_setting_file(type_)
|
149
|
-
file[key] = val
|
150
|
-
# Check values are identical
|
151
|
-
assert file[key] == file_ref[key]
|
152
|
-
# Check binary data is identical
|
153
|
-
assert file.build() == file_ref.build()
|
154
|
-
|
155
|
-
|
156
|
-
# -- DjmMySetting ----------------------------------------------------------------------
|
157
|
-
|
158
|
-
|
159
|
-
@pytest.mark.parametrize("key", DJMMYSETTING_KEYS)
|
160
|
-
def test_get_djmmysetting(key):
|
161
|
-
for expected in _get_values("djmmysetting", key):
|
162
|
-
file = _read_setting_file("djmmysetting", key, expected)
|
163
|
-
assert file[key] == expected
|
164
|
-
|
165
|
-
|
166
|
-
def test_djmmysetting_defaults():
|
167
|
-
file_default = _read_default_setting_file("djmmysetting")
|
168
|
-
file = DjmMySettingFile()
|
169
|
-
for key in DJMMYSETTING_KEYS:
|
170
|
-
assert file[key] == file_default[key]
|
171
|
-
|
172
|
-
|
173
|
-
@pytest.mark.parametrize("key", DJMMYSETTING_KEYS)
|
174
|
-
def test_set_djmmysetting(key):
|
175
|
-
type_ = "djmmysetting"
|
176
|
-
for val in _get_values(type_, key):
|
177
|
-
# Read value file
|
178
|
-
file_ref = _read_setting_file(type_, key, val)
|
179
|
-
# Read default file and update value
|
180
|
-
file = _read_default_setting_file(type_)
|
181
|
-
file[key] = val
|
182
|
-
# Check values are identical
|
183
|
-
assert file[key] == file_ref[key]
|
184
|
-
# Check binary data is identical
|
185
|
-
assert file.build() == file_ref.build()
|
186
|
-
|
187
|
-
|
188
|
-
# ======================================================================================
|
189
|
-
|
190
|
-
|
191
|
-
def test_mysetting_checksum():
|
192
|
-
file_types = "MYSETTING.DAT", "MYSETTING2.DAT", "DJMMYSETTING.DAT"
|
193
|
-
|
194
|
-
root = os.path.join(TEST_ROOT, "mysettings")
|
195
|
-
for root, _, files in os.walk(root):
|
196
|
-
for name in files:
|
197
|
-
if name not in file_types:
|
198
|
-
continue
|
199
|
-
path = os.path.join(root, name)
|
200
|
-
sett = read_mysetting_file(path)
|
201
|
-
data = sett.build()
|
202
|
-
checksum = compute_checksum(data, sett.struct)
|
203
|
-
assert checksum == sett.parsed.checksum
|