A simple script that can watch a list of directories for change and does some action

Overview

plot_watcher

A simple script that can watch a list of directories and does some action when a specific kind of change happens

In its current implementation, this script polls the directories listed as an argument (see plot_watcher.bat) for any changes. Once it finds a new .plot file created or added, it will look in the directory "../Plots" relative to the one where the change happened (so it goes back one level then enters "Plots" dir, where old plots supposedly reside, you can change this to suit your need) and if it finds any .plot files it will delete one. This will let you keep your plotter working (against your new NFT contract address) and one by one your old plots will be replaced with the newer portable ones.

Example directory structure based on the default arguments in plot_watcher.bat:

E:

|---Plots

|---Portable_Plots

F:

|---Plots

|---Portable_Plots

G:

|---Plots

|---Portable_Plots

The script will look inside the "Portable_Plots" directories and once a new .plot file is added the script will delete one .plot file from the old ones in "Plots".

DICLAIMER: This script is given AS-IS and was made for my own case, if you need an update to suit your setup you can fork it and add to it yourself. I'm not liable to any damage done from losing your 5489743159 plots, if you need to do any tests for yourself you can comment out or remove the line "os.remove(...." until your changes are tested and you're satisfied with the result.

Installation:

We make use of the module pywin32 so it needs to be installed by running the command: python -m pip install pywin32

After checking the list of portable plot directories in the .bat file, you need to make sure that either the old Plots follow the same directory structure as described above or you can edit the script to point to the right directory. This following line can be edited to point to the relative path starting from the location of the newly created plot (change this part: "..", "Plots") :

oldPlotDir = os.path.abspath(os.path.join(os.path.dirname(filename), "..", "Plots"))

Usage:

Run the bat file and leave it open to track the new plots.

plot_watcher screenshot

License and contribution

Licensed under the (GPL-compatible) MIT License:

http://www.opensource.org/licenses/mit-license.php

The change tracking functionality was shamelessly taken from this how-to guide. Thanks to the creator Tim Golden.

http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html

You might also like...
Find out where all films you want to watch are streaming
Find out where all films you want to watch are streaming

Just Watch Letterboxd Find out where all films you want to watch are streaming Ever wonder what films you want to watch are already on the streaming p

You can change your mac address with this program.
You can change your mac address with this program.

1 - Warning! You can use this program with Kali Linux. Therefore if you don't install the Kali Linux. Firstly you need to install Kali Linux. 2 - Star

a bit of my project :) and I use some of them for my school lesson or study for an exam! but some of them just for myself.
a bit of my project :) and I use some of them for my school lesson or study for an exam! but some of them just for myself.

Handy Project a bit of my project :) and I use some of them for my school lesson or study for an exam! but some of them just for myself. the handy pro

Script to change official Kali repository to mirrors

Script to change official Kali repository to mirrors. This helps increase packages update and downloading for some user.

Python script to automate the change of desktop background

wallomator Python script to automate the change of desktop background A python script that automates the process of changing the desktop background. I

A person does not exist image bot

A person does not exist image bot

This Python script can enumerate all URLs present in robots.txt files, and test whether they can be accessed or not.
This Python script can enumerate all URLs present in robots.txt files, and test whether they can be accessed or not.

Robots.txt tester With this script, you can enumerate all URLs present in robots.txt files, and test whether you can access them or not. Setup Clone t

🤖🤖 Jarvis is an virtual assistant which can some tasks easy for you like surfing on web opening an app and much more... 🤖🤖

Jarvis 🤖 🤖 Jarvis is an virtual assistant which can some tasks easy for you like surfing on web opening an app and much more... 🤖 🤖 Developer : su

List of short Codeforces problems with a statement of 1000 characters or less. Python script and data files included.

Shortest problems on Codeforces List of Codeforces problems with a short problem statement of 1000 characters or less. Sorted for each rating level. B

Comments
  • not an issue, a question

    not an issue, a question

    in the bat file you can choose the name of portable plots dir, but not the one for the old plots

    only the name plots in the same level of directories is valid?

    opened by josemanuelhda 3
  • plots erased remain in recycle bin, so no space freed

    plots erased remain in recycle bin, so no space freed

    I did a whole 5 tb drive with your software, but after drive full i changed for another one, identical, except it has 30 gb more of free space, I don't know if this has anything to do with the issue, but in this drive when your software deletes an plot it puts it in the recyble bin instead of making a full delete, so space is not freed and the software turns useless

    any hint about how to solve it?

    opened by josemanuelhda 0
Owner
Charaf Errachidi
Charaf Errachidi
A small site to list shared directories

Nebula Server Directories This site can be used to list folder and subdirectories in your server : Python It's required to have Python 3.8 or more ins

Adrien J. 1 Dec 28, 2021
Rates how pog a word or user is. Not random and does have *some* kind of algorithm to it.

PogRater :D Rates how pogchamp a word is :D A fun project coded by JBYT27 using Python3 Have you ever wondered how pog a word is? Well, congrats, you

an aspirin 2 Jun 25, 2022
Uproot - A script to bring deeply nested files or directories to the surface

UPROOT Bring deeply nested files or folders to the surface Uproot helps convert

Ted 2 Jan 15, 2022
Islam - This is a simple python script.In this script I have written all the suras of Al Quran. As a result, by using this script, you can know the number of any sura at the moment.

Introduction: If you want to know sura number of al quran by just typing the name of sura than you can use this script. Usage in termux: $ pkg install

Fazle Rabbi 1 Jan 2, 2022
poro is a LCU interface to change some lol's options.

poro is a LCU interface to change some lol's options. with this program you can: change your profile icon change your profiel background image ch

João Dematte 2 Jan 5, 2022
Simple application that does transformation with HPF and LPFs.

Simple application that applies Butterworth, Gaussian & Ideal kernels on HPF and LPFs -aka Frequency Domain Filtering- Upload image from sidebar, set

Merve Noyan 3 Jul 6, 2022
A little tool that uses LLVM to extract simple "what does this do" level instruction information from all architectures.

moirai: MOre InstRuctions and Information Backcronym. Anyway, this is a small project to extract useful instruction definitions from LLVM's platform d

null 2 Jul 30, 2022
ripgrep recursively searches directories for a regex pattern while respecting your gitignore

ripgrep (rg) ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern. By default, ripgrep will resp

Andrew Gallant 35k Dec 31, 2022
A tool to quickly create codeforces contest directories with templates.

Codeforces Template Tool I created this tool to help me quickly set up codeforces contests/singular problems with templates. Tested for windows, shoul

null 1 Jun 2, 2022
Archive, organize, and watch for changes to publicly available information.

0. Overview The Trapper Keeper is a collection of scripts that support archiving information from around the web to make it easier to study and use. I

Bill Fitzgerald 9 Oct 26, 2022