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_config.py
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Author: Dylan Jones
|
3
|
-
# Date: 2023-10-02
|
4
|
-
|
5
|
-
import pytest
|
6
|
-
import json
|
7
|
-
from pathlib import Path
|
8
|
-
from pyrekordbox.config import update_config, get_config
|
9
|
-
|
10
|
-
RB_SETTING = """<?xml version="1.0" encoding="UTF-8"?>
|
11
|
-
<PROPERTIES><VALUE name="masterDbDirectory" val="{db_dir}"/></PROPERTIES>
|
12
|
-
"""
|
13
|
-
|
14
|
-
RB_OPTIONS = {"options": [["db-path", ""]]}
|
15
|
-
|
16
|
-
|
17
|
-
def mock_rekordbox_settings_file(pioneer_app_dir, rb_app_dir):
|
18
|
-
db_dir = pioneer_app_dir / "rekordbox"
|
19
|
-
text = RB_SETTING.format(db_dir=db_dir)
|
20
|
-
file = rb_app_dir / "rekordbox3.settings"
|
21
|
-
file.write_text(text)
|
22
|
-
|
23
|
-
|
24
|
-
def mock_rekordbox_options_file(agent_storage_dir, db_path):
|
25
|
-
file = agent_storage_dir / "options.json"
|
26
|
-
options = RB_OPTIONS.copy()
|
27
|
-
options["options"][0][1] = str(db_path)
|
28
|
-
with open(file, "w") as fp:
|
29
|
-
json.dump(options, fp)
|
30
|
-
|
31
|
-
|
32
|
-
@pytest.fixture(scope="session")
|
33
|
-
def pioneer_app_dir(tmp_path_factory):
|
34
|
-
root = tmp_path_factory.mktemp("Pioneer")
|
35
|
-
rb_dir = root / "rekordbox"
|
36
|
-
rb6_dir = root / "rekordbox6"
|
37
|
-
agent_storage_dir = root / "rekordboxAgent" / "storage"
|
38
|
-
rb_dir.mkdir(parents=True)
|
39
|
-
rb6_dir.mkdir(parents=True)
|
40
|
-
agent_storage_dir.mkdir(parents=True)
|
41
|
-
|
42
|
-
# Mock `rekordbox3.settings` files
|
43
|
-
mock_rekordbox_settings_file(root, rb_dir)
|
44
|
-
mock_rekordbox_settings_file(root, rb6_dir)
|
45
|
-
|
46
|
-
# Mock database files
|
47
|
-
rb5_db = rb_dir / "datafile.edb"
|
48
|
-
rb6_db = rb_dir / "master.db"
|
49
|
-
rb5_db.touch()
|
50
|
-
rb6_db.touch()
|
51
|
-
|
52
|
-
# Mock `options.json` file (RBv6)
|
53
|
-
mock_rekordbox_options_file(agent_storage_dir, rb6_db)
|
54
|
-
|
55
|
-
return root
|
56
|
-
|
57
|
-
|
58
|
-
@pytest.fixture(scope="session")
|
59
|
-
def pioneer_install_dir(tmp_path_factory):
|
60
|
-
root = tmp_path_factory.mktemp("Pioneer")
|
61
|
-
rb5_dir = root / "rekordbox 5.1.1"
|
62
|
-
rb6_dir = root / "rekordbox 6.1.1"
|
63
|
-
rb5_dir_alt = root / "rekordbox 5.1.2"
|
64
|
-
rb6_dir_alt = root / "rekordbox 6.1.2"
|
65
|
-
|
66
|
-
rb5_dir.mkdir(parents=True)
|
67
|
-
rb6_dir.mkdir(parents=True)
|
68
|
-
rb5_dir_alt.mkdir(parents=True)
|
69
|
-
rb6_dir_alt.mkdir(parents=True)
|
70
|
-
return root
|
71
|
-
|
72
|
-
|
73
|
-
def test_pioneer_config(pioneer_install_dir, pioneer_app_dir):
|
74
|
-
update_config(pioneer_install_dir, pioneer_app_dir)
|
75
|
-
install_dir = get_config("pioneer", "install_dir")
|
76
|
-
app_dir = get_config("pioneer", "app_dir")
|
77
|
-
|
78
|
-
assert isinstance(install_dir, Path)
|
79
|
-
assert isinstance(app_dir, Path)
|
80
|
-
assert install_dir == pioneer_install_dir
|
81
|
-
assert app_dir == pioneer_app_dir
|
82
|
-
|
83
|
-
|
84
|
-
def test_rb5_config(pioneer_install_dir, pioneer_app_dir):
|
85
|
-
update_config(pioneer_install_dir, pioneer_app_dir)
|
86
|
-
expected_version = "5.1.2"
|
87
|
-
|
88
|
-
app_dir = get_config("rekordbox5", "app_dir")
|
89
|
-
install_dir = get_config("rekordbox5", "install_dir")
|
90
|
-
db_dir = get_config("rekordbox5", "db_dir")
|
91
|
-
db_path = get_config("rekordbox5", "db_path")
|
92
|
-
version = get_config("rekordbox5", "version")
|
93
|
-
|
94
|
-
assert isinstance(install_dir, Path)
|
95
|
-
assert isinstance(app_dir, Path)
|
96
|
-
assert isinstance(db_dir, Path)
|
97
|
-
assert isinstance(db_path, Path)
|
98
|
-
assert install_dir == (pioneer_install_dir / f"rekordbox {expected_version}")
|
99
|
-
assert app_dir == (pioneer_app_dir / "rekordbox")
|
100
|
-
assert db_dir == (pioneer_app_dir / "rekordbox")
|
101
|
-
assert db_path == (pioneer_app_dir / "rekordbox" / "datafile.edb")
|
102
|
-
assert version == expected_version
|
103
|
-
|
104
|
-
|
105
|
-
def test_rb6_config(pioneer_install_dir, pioneer_app_dir):
|
106
|
-
update_config(pioneer_install_dir, pioneer_app_dir)
|
107
|
-
expected_version = "6.1.2"
|
108
|
-
|
109
|
-
app_dir = get_config("rekordbox6", "app_dir")
|
110
|
-
install_dir = get_config("rekordbox6", "install_dir")
|
111
|
-
db_dir = get_config("rekordbox6", "db_dir")
|
112
|
-
db_path = get_config("rekordbox6", "db_path")
|
113
|
-
version = get_config("rekordbox6", "version")
|
114
|
-
|
115
|
-
assert isinstance(install_dir, Path)
|
116
|
-
assert isinstance(app_dir, Path)
|
117
|
-
assert isinstance(db_dir, Path)
|
118
|
-
assert isinstance(db_path, Path)
|
119
|
-
assert install_dir == (pioneer_install_dir / f"rekordbox {expected_version}")
|
120
|
-
assert app_dir == (pioneer_app_dir / "rekordbox6")
|
121
|
-
assert db_dir == (pioneer_app_dir / "rekordbox")
|
122
|
-
assert db_path == (pioneer_app_dir / "rekordbox" / "master.db")
|
123
|
-
assert version == expected_version
|
124
|
-
|
125
|
-
|
126
|
-
def test_rb5_config_alt(pioneer_install_dir, pioneer_app_dir):
|
127
|
-
# test default: latest version
|
128
|
-
update_config(pioneer_install_dir, pioneer_app_dir)
|
129
|
-
expected_version = "5.1.2"
|
130
|
-
|
131
|
-
app_dir = get_config("rekordbox5", "app_dir")
|
132
|
-
install_dir = get_config("rekordbox5", "install_dir")
|
133
|
-
version = get_config("rekordbox5", "version")
|
134
|
-
assert install_dir == (pioneer_install_dir / f"rekordbox {expected_version}")
|
135
|
-
assert app_dir == (pioneer_app_dir / "rekordbox")
|
136
|
-
assert version == expected_version
|
137
|
-
|
138
|
-
# test alternative version
|
139
|
-
update_config(
|
140
|
-
pioneer_install_dir, pioneer_app_dir, rb5_install_dirname="rekordbox 5.1.1"
|
141
|
-
)
|
142
|
-
expected_version = "5.1.1"
|
143
|
-
|
144
|
-
app_dir = get_config("rekordbox5", "app_dir")
|
145
|
-
install_dir = get_config("rekordbox5", "install_dir")
|
146
|
-
version = get_config("rekordbox5", "version")
|
147
|
-
assert install_dir == (pioneer_install_dir / f"rekordbox {expected_version}")
|
148
|
-
assert app_dir == (pioneer_app_dir / "rekordbox")
|
149
|
-
assert version == expected_version
|
150
|
-
|
151
|
-
|
152
|
-
def test_rb6_config_alt(pioneer_install_dir, pioneer_app_dir):
|
153
|
-
# test default: latest version
|
154
|
-
update_config(pioneer_install_dir, pioneer_app_dir)
|
155
|
-
expected_version = "6.1.2"
|
156
|
-
|
157
|
-
app_dir = get_config("rekordbox6", "app_dir")
|
158
|
-
install_dir = get_config("rekordbox6", "install_dir")
|
159
|
-
version = get_config("rekordbox6", "version")
|
160
|
-
assert install_dir == (pioneer_install_dir / f"rekordbox {expected_version}")
|
161
|
-
assert app_dir == (pioneer_app_dir / "rekordbox6")
|
162
|
-
assert version == expected_version
|
163
|
-
|
164
|
-
# test alternative version
|
165
|
-
update_config(
|
166
|
-
pioneer_install_dir, pioneer_app_dir, rb6_install_dirname="rekordbox 6.1.1"
|
167
|
-
)
|
168
|
-
expected_version = "6.1.1"
|
169
|
-
|
170
|
-
app_dir = get_config("rekordbox6", "app_dir")
|
171
|
-
install_dir = get_config("rekordbox6", "install_dir")
|
172
|
-
version = get_config("rekordbox6", "version")
|
173
|
-
assert install_dir == (pioneer_install_dir / f"rekordbox {expected_version}")
|
174
|
-
assert app_dir == (pioneer_app_dir / "rekordbox6")
|
175
|
-
assert version == expected_version
|