Open comments for this post
#Devlog #2
I actually did this a while ago but I was waiting for the ship function and I also did not have a demo link.
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.
Open comments for this post
#Sentinel File Organizer Devlog #4
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.
Open comments for this post
In progress of making the GUI using PyQt6, Still working on it :)
Open comments for this post
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.
Open comments for this post
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.
Open comments for this post
Finished 5 commands and runs 24/7. Now I just need a demo website. :p
Open comments for this post
Finished Coding The project!