Skip to content

Commit cc5738b

Browse files
committed
0.1.0
1 parent e6a676b commit cc5738b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+4429
-2007
lines changed

.github/workflows/main.yml

Whitespace-only changes.

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,5 @@ dmypy.json
137137
# Cython debug symbols
138138
cython_debug/
139139

140-
# Until testing doesn't work, I will use main.py
140+
# Just easier than running tests
141141
main.py
142-
tests/assets/*.flp
143-
tests/assets/*.flp.bak

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/psf/black
9+
rev: 19.3b0
10+
hooks:
11+
- id: black

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"python.testing.unittestEnabled": false,
3-
"python.testing.pytestEnabled": true
4-
}
3+
"python.testing.pytestEnabled": true,
4+
"python.formatting.provider": "black"
5+
}

.vscode/tasks.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "black",
8+
"type": "shell",
9+
"command": "black .",
10+
"problemMatcher": []
11+
},
12+
{
13+
"label": "tests",
14+
"type": "shell",
15+
"command": "py.test",
16+
"problemMatcher": []
17+
},
18+
{
19+
"label": "build",
20+
"type": "shell",
21+
"command": "py -3.9 -m build .",
22+
"problemMatcher": [],
23+
"group": {
24+
"kind": "build",
25+
"isDefault": true
26+
}
27+
},
28+
{
29+
"label": "docs",
30+
"type": "shell",
31+
"command": "cd docs && ./make html",
32+
"problemMatcher": []
33+
},
34+
{
35+
"label": "mypy",
36+
"type": "shell",
37+
"command": "mypy . --no-strict-optional"
38+
}
39+
]
40+
}

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# 0.1.0
2+
3+
## **Highlights**
4+
5+
- `flpinspect` - An FLP Event Viewer made using Tkinter.
6+
- `flpinfo` - A CLI utility to get basic information about an FLP.
7+
- Switched to MIT License
8+
9+
## Additions
10+
11+
- Lots of changes, refactoring and code cleanup of `pyflp`
12+
- New docs
13+
- Changes to `README`
14+
- Adopted [`black`](https://github.com/psf/black) coding style
15+
- Added a `log_level` argument to `Parser`
16+
- `Project.create_zip` copies stock samples as well now
17+
- `Project.get_events` for getting just the events; they are not parsed.
18+
Read [docs](https://pyflp.rtfd.io) for more info about this
19+
- `Event` classes now have an `__eq__` and `__repr__` method
20+
21+
## Bug fixes
22+
23+
- Tests don't give module import errors
24+
- `Pattern` event parsing
25+
- Initialise `_count` to 0, everytime `Parser` is initialised
26+
- `Project.create_zip` now works as intended
27+
- Overhauled logging
28+
- A lot of potential bugs in `FLObject` subclasses
29+
30+
## Known issues
31+
32+
- `flpinfo` doesn't output correctly sometimes due to long strings
33+
- Extraneous data dumped sometimes by `InsertSlotEvent.Plugin`, why this is caused is not known

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

MANIFEST.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include *.md
2+
include tox.ini
3+
recursive-include docs *.bat
4+
recursive-include docs *.md
5+
recursive-include docs *.py
6+
recursive-include docs *.rst
7+
recursive-include docs Makefile
8+
recursive-include pyflp *.py
9+
recursive-include tests *.md
10+
recursive-include tests *.py
11+
recursive-include tests *.flp

README.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,48 @@
11
[![Documentation Status](https://readthedocs.org/projects/pyflp/badge/?version=latest)](https://pyflp.readthedocs.io/en/latest/?badge=latest)
22
![PyPI - License](https://img.shields.io/pypi/l/pyflp)
33
![PyPI](https://img.shields.io/pypi/v/pyflp?color=blue)
4+
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyflp)
5+
![Code Style: Black](https://img.shields.io/badge/code%20style-black-black)
46

57
# PyFLP
6-
PyFLP creates an object from an FLP. You can edit it and save it back also. *Please don't use this for serious stuffs, I have done minimal testing myself and much of the features are yet to be implemented.*
78

8-
It also has useful utilities like:
9-
* Creating a ZIP looped package from an FLP
9+
PyFLP allows an object oriented access to an FLP. This provides an abstraction from its TLV implementation. _Please don't use this for serious stuffs yet._
10+
11+
You should also check these:
12+
- A CLI utility **FLPInfo** to see basic information about an FLP.
13+
- A GUI tool **FLPInspect** for a further, detailed view into the internal structure of an FLP.
1014

1115
## Usage
16+
17+
PyFLP can be used for automation purposes e.g. finding/setting project titles, artists names, genre etc. and also by people who are interested more about the FLP format. You can even repair a broken FLP, *ofcourse by yourself*.
18+
19+
### Initialisation
20+
1221
```{code-block} python
13-
from pyflp.parser import ProjectParser
14-
project = ProjectParser().parse("/path/to/efelpee.flp")
22+
from pyflp import Parser
23+
project = Parser(verbose=True).parse("/path/to/efelpee.flp")
24+
```
25+
26+
### Saving
1527

16-
# Use ProjectParser(verbose=True) if you want to see logs
28+
```{code-block} python
29+
project.save(save_path="/path/to/save.flp")
30+
```
31+
32+
### Export it as a ZIP looped package
33+
34+
```{code-block} python
35+
project.create_zip(path="/path/to/flp.zip")
1736
```
1837

1938
## Installation
2039

21-
```{code-block}
40+
```
2241
pip install pyflp
2342
```
2443

2544
## Testing
45+
2646
I have created a [null test](tests/test_parser.py). More tests need to be added.
2747

2848
## Thanks
@@ -33,4 +53,4 @@ I have created a [null test](tests/test_parser.py). More tests need to be added.
3353

3454
## Contributions
3555

36-
If you can spare some time for testing and/or contributing, I would be very grateful. Please check the [TODO](TODO.md) as well for current goals/issues. You can reach me at **demberto**[at]**protonmail**[dot]**com** as well :)
56+
If you can spare some time for testing and/or contributing, I would be very grateful. Please check the [TODO](TODO.md) as well for current goals/issues. Its kind of getting difficult for me as this project becomes bigger. You can reach me at **demberto**[at]**protonmail**[dot]**com** as well :)

TODO.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1-
* `Misc.start_date` parse logic raises **OverflowError**
2-
* **repr()** for `FLObject` subclasses
3-
* `max_count` - required or not?
4-
* Use the same event system used in other FLObjects for `Plugin` but make the `save()` method recombine it into a single event (Events inside event)
5-
* Instead of creating objects in a single go, create them in multiple layers of parsing. I think this is what FL also does
6-
* `PatternEventID.New` event occurs twice, doesn't get dumped twice as parsing logic replaces previous instance when it occurs 2nd time
7-
* Test for verifying that the data chunk length == size of events
8-
* `Project.save()` must check for changed to certain `Misc` properties, which cannot be set by `Misc` itself as they are not events.
9-
* Pattern controller events
1+
### PyFLP
2+
3+
- `Misc.start_date` parse logic raises **OverflowError**
4+
- **repr()** for `FLObject` subclasses
5+
- Use the same event system used in other FLObjects for `Plugin` but make the `save()` method recombine it into a single event (Events inside event)
6+
- Instead of creating objects in a single go, create them in multiple layers of parsing. I think this is what FL also does
7+
- Test for verifying that the data chunk length == size of events
8+
- Pattern controller events
9+
- `_count` variables being static become useless when `Parser` is reinitalised
10+
- Switch over to [`BytesIOEx`](https://github.com/demberto/bytesioex)
11+
- First pattern doesn't get a name after saving
12+
- Saving an FLP back into a ZIP
13+
- Extraneous data dumped sometimes by `InsertSlotEvent.Plugin`, why this is caused is not known
14+
15+
### FLPInspect
16+
17+
- Progress bar
18+
- Fix high CPU usage
19+
- Support event editing
20+
- Warnings and errors are ignored by `GUIHandler` if verbose mode is not enabled
21+
- Tooltips are a mess
22+
- Tests
23+
24+
### FLPInfo
25+
26+
- Long comments cause incorrect formatting
27+
- Tests

0 commit comments

Comments
 (0)