skytreader / chadow Goto Github PK
View Code? Open in Web Editor NEWA file back-up system for personal use
A file back-up system for personal use
To bound the execution of the index function.
Ideally, if there are directories to traverse beyond the given depth, the logs will warn the user of these unreachable directories.
We've decided to stick with SemVer protocols. The __version_check
function should perform smarter checks based on SemVer: allow backwards-compatibility when possible, terminate (?) if not.
Looks like equality test for DirectoryIndex
is dependent on the order items are added rather than being treated like a set.
To debug, print out the indices compared in the test.
(chadow) chad@scheherazade:~$ python ~/.chadow/chadow.py createlib photos
Traceback (most recent call last):
File "/home/chad/.chadow/chadow.py", line 24, in <module>
VERSION: str = get_version()
File "/home/chad/.chadow/chadow.py", line 12, in get_version
with open("VERSION") as v:
FileNotFoundError: [Errno 2] No such file or directory: 'VERSION'
(chadow) chad@scheherazade:~$ ls ~/.chadow/
chadow.py config.json testlib
(chadow) chad@scheherazade:~$ cd kode/chadow/
(chadow) chad@scheherazade:chadow$ python ~/.chadow/chadow.py createlib photos
INFO: Writing config file: /home/chad/.chadow/config.json
INFO: Created new lib: photos
(chadow) chad@scheherazade:chadow$
Also check, how come this is not showing up in bats tests?
At least this is a user-friendliness improvement so users don't have to refer to full paths for commands.
Ultimately, this should be useful for when mount paths go awry (just refer to the alias!).
deletelib
, deletesector
, deletemedia
Naturally, prompt the user for confirmation before doing this.
lslib
, lssector
, lsmedia
In line with #12.
lslib
lssec LIBRARY
lsmed LIBRARY SECTOR
As things stand, we assume that paths within a sector contain unique subsets of the entire library, but taken together all sectors should, in the end, have the same files.
But within a sector, we may have two media which are intersecting or possibly even complete replicas.
Exit code 1 is already returned by the Python interpreter for an exception. Therefore, any exception we did not expect will return an error code similar to CONFIG_NOT_FOUND
.
Maybe by making a reset script so that the virtualenv does not have to be uninstalled/installed after/before each and every test.
/media/chad/PHOTOS/
and /media/chad/PHOTOS
are the same but the trailing slash makes a difference right now.
All commands that take in a path should normalize properly like this.
chadow.py [TAB]
should list the available commands (kind of similar to chadow.py --help
).
chadow.py <command> [TAB]
should list the existing values that could be used as arguments for the command.
Try:
createlib library
regsector library flash
regmedia library flash /media/usr/LIBRARY
When that media path was indexed in a different installation already, it becomes impossible to manage it in a different installation.
Solution: When "installing" chadow, generate a UUID in the config (with uuidgen
) then save this UUID in the metadata of the media path.
This is a "nuclear option" in case the management of the directory has become so convoluted.
This is a destructive operation so user-confirmation is required.
First of all we must consider how this will affect the indices where the directory is listed.
Just for good practice, in general.
This means that chadow installation would have to create a dedicated Linux user (which is just good practice) and that chadow should run under that user. But the chadow user must be granted read access at most to the directories that will be registered to it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.