Ran into an infinite loop bug early on, fixed the git email privacy block, fought with GitHub Actions for cross-platform builds. Got it shipped to GitHub with a workflow for Windows, Linux, and Mac binaries. Mac build is still being annoying.
Spent way too long on indentation bugs today. The with open nesting issue in add_to_feed and undo_last killed most of the session. I kept mixing up read and write blocks kept and they kept ending up inside each other.
Eventually got there. Rules engine is wired into the GUI, undo button works, dotfile filtering is in. I downloaded a random worksheet to test out my undo function and it did not work.
After that Im going to make the GUI Japanese theme.
Today I added the basic layout of my GUI:
I implemented the main window layout using PyQt6. The interface is now divided into two panels:
Left Panel:
Activity Feed label
Activity Feed list widget
Displays files detected by the watcher in real time
Right Panel
Status label
Status list widget
Undo button (Currently Does Not Work, Still did not Wire everything)
I used QVBoxLayout, QLabel, QPushButton, Q Widget and QListWidget
#Devlog #2
I added 2 things:
#1: I added slck-motivate
#2: I added slck-shrug
I also updated /slck-list. I removed /slck-time because it took the local time of the nest server rather than whichever device /slck-time was run on. The code is still in VS code but /slck-time is removed from the commands.
I could not post devlogs because I had a bug where hackatime and stardance challenge were not syncing properly but It got fixed.
Today I added more rules(after I realized it only sorts .pdf) , before it was only sorting pdf files before and now it is sorting much more.
Now it is sorting:
-Documents: .pdf, .docx, .doc, .txt
-Images: .png, .jpg, .jpeg, .gif, .tiff, .svg
-Archives: .zip, .tar, .gz, .deb, .rar
-Videos: .mp4, .avi, .mov, .wmv, .flv
-Audios: .mp3, .wav, .flac, .aac
There was 2 bugs I had today:
file_type in the config was a single string so in wouldn’t work properly, and .lower was missing its parentheses so it was never actually being called.
I was planing to work on the GUI today but I did not, I will do that tomorrow.
In progress of making the GUI using PyQt6, Still working on it :)
Phase 1 of Sentinel is done. The entire backend logic is built and working. (Right Now it only sorts .pdf, sorting other types of files is part of phase 2)
Built a file scanner using pathlib. Path that reads a folder and prints each file’s name, extension, and size. Then extended it to move files based on their extension using shutil.move().
Added a JSON config system that loads and saves rules persistently between sessions. Each rule stores a name, file type, and destination folder.
Integrated watchdog to watch a folder in real time. When a new file appears, the rules engine checks its extension, finds a matching rule, creates the destination folder if needed, and moves the file automatically.
Finally built an undo system. Every automated move gets logged to config.json with the source and destination. Calling undo_last() reverses the most recent move and removes it from history.
Phase 2 starts now, replacing the terminal output with a PyQt6 desktop GUI and adding more rules to sort more types of files.
I had a bug for the past few days that did not let me log hours. Here’s what I did:
part 1 - I created code that scans folders using pathlib.path and printed each files name that got moved.
Part 2 - Takes a hardcoded source file and destination folder, creates the destination if it doesn’t exist using .mkdir(parents = True, exist_ok = True), and moves the file using shutil.move()
Part 3 - Loads rules from config.json using json.load() prints them and has an add_rule() function that function that appends a new rule dict and saves the updated list back using json.dump()
Part 4- A live file watcher using watchdog. Creates a Sentinel Handler class that inherits from FileSystemEventHandler and overrides on_created to print the path of any new file. Uses an Observer to watch the Downloads folder in the background. Keeps the program alive using an while True loop and stops the program using KeyboardInterrupt
Part 5 - Extends Part 4 with a rules engine. When a file is created on_created loads rules from config.json, checks if file’s extensions matches any rules file_type, creates the destination folder if needed and moves the file automatically using shutil.move()
Part 6 - Still in progress. Extends Part 5 with an undo history.
Finished 5 commands and runs 24/7. Now I just need a demo website. :p
Finished Coding The project! I post devlogs due to hackatime and stardance not syncing properly at some point.