Commit Graph

22 Commits

Author SHA1 Message Date
Isaiah Odhner
faa9c76ba8 Test file drag-and-drop handling 2023-09-14 02:03:52 -04:00
Isaiah Odhner
7f91138a63 Use pyfakefs for file dialog tests
- The app's directory structure is not a constant, and shouldn't play into this test. Aside from codebase restructuring, directories like `__pycache__` can come and go.
- Even if a temporary directory were created with files enough to fill the view, the scrollbar would still change based on the folder structure outside of the temporary folder.
- pyfakefs is one way to ensure a consistent view of a folder structure for testing. It allows adding real folders in a readonly way. It's more complicated than I thought it would be going in, since I had to add workarounds for pyfiglet and pytest-textual-snapshot, and handle an edge case in my EnhancedDirectoryTree (which got an error which seems to be swallowed?), not to mention pyfakefs raises an error saying "No such file or directory in the fake filesystem" when actually it's the real directory not existing when trying to add it to the fake filesystem, and VS Code was hiding stack frames and refusing to step into library code, and it turned out that I was resolving the absolute path wrong, but it looked right to me because the only part that was missing was "textual-paint", when, at a glance it seemed present, since the "textual_paint" part was present. Ay-ay-ay!
- I don't know if this will fix the problem I saw where these tests' snapshots all changed with no visual or even structural changes, just the IDs of elements changing. I don't know what caused that.

Oh yeah and this is still actually a problem:
============================================= short test summary info ==============================================
FAILED tests/test_snapshots.py::test_paint_open_dialog[light_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_open_dialog[dark_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_open_dialog[light_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_open_dialog[dark_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[light_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[dark_unicode] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[light_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
FAILED tests/test_snapshots.py::test_paint_save_dialog[dark_ascii] - AttributeError: 'EnhancedDirectoryTree' object has no attribute '_id'. Did you mean: 'id'?
========================== 8 failed, 56 passed, 1 xfailed, 1 warning in 152.86s (0:02:32) ==========================
It worked when running in debug, but not when running normally.
2023-09-12 19:45:41 -04:00
Isaiah Odhner
ed97f0afb0 WIP: set up snapshot testing 2023-09-07 15:19:10 -04:00
Isaiah Odhner
f81e5d8250 Bump textual to 0.28.0, needed for pytest-textual-snapshot 2023-09-07 15:13:47 -04:00
Isaiah Odhner
8626fa775c Update note about watchdog
It's no longer required, since commit "Make watchdog properly optional" da0e5e52da
2023-09-06 00:05:26 -04:00
Isaiah Odhner
1c64fdb78c Fix Python rocket icon showing in dock on macOS after Set As Wallpaper 2023-07-18 18:32:32 -04:00
Isaiah Odhner
eb0f781ca8 Get screen size with tkinter instead
screeninfo caused a bouncing python rocket in the dock on mac, and didn't work.
2023-07-18 14:15:36 -04:00
Isaiah Odhner
7f3fe53d3e Get screen size properly, with screeninfo module 2023-07-18 14:03:51 -04:00
Isaiah Odhner
033e86f4e7 Make psutil optional
It's hard to install on Windows, and this seems to be misleading:

    ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects
2023-07-17 19:18:31 -04:00
Isaiah Odhner
9c8c035d14 Add type stubs for Pillow and psutil 2023-07-15 21:53:09 -04:00
Isaiah Odhner
a8bb2b253e Update Textual to 0.27.0
(Gonna use some tooltips!)
2023-06-04 15:28:14 -04:00
Isaiah Odhner
e9755637d6 Update Textual to 0.26.0
Both issues I opened have been fixed! :)
2023-05-21 22:00:39 -04:00
Isaiah Odhner
498b4ccd0a Update textual to 0.24.1
Gonna use the new `@on` decorator, and Select widget.
2023-05-17 10:47:44 -04:00
Isaiah Odhner
e1245aa9e9 Load FIGlet font format 2023-05-16 20:14:17 -04:00
Isaiah Odhner
4dbaf5145e Open and save image files with Pillow 2023-05-15 00:46:08 -04:00
Isaiah Odhner
6cf59cd79a Tweak requirements.txt so I can actually install from it
I'm setting up a virtual environment for the first time, and, trying
to install my dependencies, I ran into errors, 1. because of appscript
which is only intended for Mac, 2. PyGObject which IS for Linux, but
fails to install, missing "libgirepository1.0-dev", but it's optional,
it's just for wallpaper support. pyxgd is also for wallpaper support,
so maybe I should comment it out too.
And finally, [dev] is needed in order to use the `textual` command.

I don't know how well this can install on other systems, but at least
I can install it now, on Ubuntu.

Also, when the version numbers in my requirements.txt were bumped
when regenerating it, I'm guessing now that the dependencies weren't
actually upgraded, since `textual --version` gave me "0.19.1" up until
I set up my virtual environment (.venv), and now it matches the
requirements.txt version of "0.22.3". I still don't know why the version
numbers were bumped, or for sure that they weren't installed at those
versions somewhere in my filesystem. (I hope virtualenv makes things
more comprehensible, rather than more confusing...)

Also, now that I'm using textual 0.22.3, the radio button set has
arrow key navigation. Seeing this feature missing was what prompted me
to set up the virtual environment and (sort of implicitly) upgrade.
However, it doesn't work correctly, for the flipped horiz./vert. layout.
2023-05-05 00:54:52 -04:00
Isaiah Odhner
8b220efee8 Update requirements.txt
- This includes dependencies that are only for wallpaper support.
- I still don't know when or how my dependencies are getting updated.
2023-04-29 19:48:11 -04:00
Isaiah Odhner
0c3cc45ddd Start implementing copy/paste with pyperclip 2023-04-26 12:28:42 -04:00
Isaiah Odhner
140ff15ff1 Restart the app on changes 2023-04-19 14:27:12 -04:00
Isaiah Odhner
34aa35ec8b Update dependencies
I'm new to python package management, so I don't really know when these
packages got updated, but I'm updating this file with this command:

    python3 -m pipreqs.pipreqs --ignore .history --force
2023-04-19 02:42:54 -04:00
Isaiah Odhner
30cddbbde5 Save and load ANSI files 2023-04-11 21:18:11 -04:00
Isaiah Odhner
66bb55afd2 Create requirements.txt 2023-04-11 21:14:23 -04:00