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.
Files changed (84) hide show
  1. pyrekordbox/__init__.py +8 -8
  2. pyrekordbox/__main__.py +3 -2
  3. pyrekordbox/_version.py +2 -2
  4. pyrekordbox/anlz/__init__.py +3 -2
  5. pyrekordbox/anlz/file.py +4 -2
  6. pyrekordbox/anlz/tags.py +3 -1
  7. pyrekordbox/config.py +79 -23
  8. pyrekordbox/db6/__init__.py +2 -2
  9. pyrekordbox/db6/aux_files.py +3 -2
  10. pyrekordbox/db6/database.py +227 -143
  11. pyrekordbox/db6/registry.py +1 -0
  12. pyrekordbox/db6/smartlist.py +375 -0
  13. pyrekordbox/db6/tables.py +81 -20
  14. pyrekordbox/logger.py +0 -1
  15. pyrekordbox/mysettings/__init__.py +5 -4
  16. pyrekordbox/mysettings/file.py +3 -1
  17. pyrekordbox/rbxml.py +5 -3
  18. pyrekordbox/utils.py +4 -3
  19. {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/LICENSE +1 -1
  20. {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/METADATA +26 -42
  21. pyrekordbox-0.4.0.dist-info/RECORD +25 -0
  22. {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/WHEEL +1 -1
  23. {pyrekordbox-0.3.1.dist-info → pyrekordbox-0.4.0.dist-info}/top_level.txt +0 -2
  24. docs/Makefile +0 -20
  25. docs/make.bat +0 -35
  26. docs/source/_static/images/anlz_beat.svg +0 -53
  27. docs/source/_static/images/anlz_file.svg +0 -204
  28. docs/source/_static/images/anlz_pco2.svg +0 -138
  29. docs/source/_static/images/anlz_pcob.svg +0 -148
  30. docs/source/_static/images/anlz_pcp2.svg +0 -398
  31. docs/source/_static/images/anlz_pcpt.svg +0 -263
  32. docs/source/_static/images/anlz_ppth.svg +0 -123
  33. docs/source/_static/images/anlz_pqt2.svg +0 -324
  34. docs/source/_static/images/anlz_pqt2_2.svg +0 -253
  35. docs/source/_static/images/anlz_pqtz.svg +0 -140
  36. docs/source/_static/images/anlz_pssi.svg +0 -192
  37. docs/source/_static/images/anlz_pssi_entry.svg +0 -191
  38. docs/source/_static/images/anlz_pvbr.svg +0 -125
  39. docs/source/_static/images/anlz_pwav.svg +0 -130
  40. docs/source/_static/images/anlz_pwv3.svg +0 -139
  41. docs/source/_static/images/anlz_pwv4.svg +0 -139
  42. docs/source/_static/images/anlz_pwv5.svg +0 -139
  43. docs/source/_static/images/anlz_pwv5_entry.svg +0 -100
  44. docs/source/_static/images/anlz_pwv6.svg +0 -130
  45. docs/source/_static/images/anlz_pwv7.svg +0 -139
  46. docs/source/_static/images/anlz_pwvc.svg +0 -125
  47. docs/source/_static/images/anlz_tag.svg +0 -110
  48. docs/source/_static/images/x64dbg_rb_key.png +0 -0
  49. docs/source/_static/logos/dark/logo_primary.svg +0 -75
  50. docs/source/_static/logos/light/logo_primary.svg +0 -75
  51. docs/source/_static/logos/mid/logo_primary.svg +0 -75
  52. docs/source/_templates/apidoc/module.rst_t +0 -8
  53. docs/source/_templates/apidoc/package.rst_t +0 -57
  54. docs/source/_templates/apidoc/toc.rst_t +0 -7
  55. docs/source/_templates/autosummary/class.rst +0 -32
  56. docs/source/_templates/autosummary/module.rst +0 -55
  57. docs/source/api.md +0 -18
  58. docs/source/conf.py +0 -178
  59. docs/source/development/changes.md +0 -3
  60. docs/source/development/contributing.md +0 -3
  61. docs/source/formats/anlz.md +0 -634
  62. docs/source/formats/db6.md +0 -1233
  63. docs/source/formats/mysetting.md +0 -392
  64. docs/source/formats/xml.md +0 -376
  65. docs/source/index.md +0 -103
  66. docs/source/installation.md +0 -271
  67. docs/source/key.md +0 -103
  68. docs/source/quickstart.md +0 -185
  69. docs/source/requirements.txt +0 -7
  70. docs/source/tutorial/anlz.md +0 -7
  71. docs/source/tutorial/configuration.md +0 -66
  72. docs/source/tutorial/db6.md +0 -178
  73. docs/source/tutorial/index.md +0 -20
  74. docs/source/tutorial/mysetting.md +0 -124
  75. docs/source/tutorial/xml.md +0 -140
  76. pyrekordbox/db6/smart_playlist.py +0 -333
  77. pyrekordbox/xml.py +0 -8
  78. pyrekordbox-0.3.1.dist-info/RECORD +0 -84
  79. tests/__init__.py +0 -3
  80. tests/test_anlz.py +0 -206
  81. tests/test_config.py +0 -175
  82. tests/test_db6.py +0 -1115
  83. tests/test_mysetting.py +0 -203
  84. 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