The GUI version is ready. inon3135/CopyWithLog
When visualizing data in posters and papers, the image file to be pasted is I want to keep it together with the document file. But while looking at the file, ** "Which of this data?" ** is Zara. So when you copy a file, the copy source and copy destination are generated as log files in each folder. I wrote a copy script.
From here https://codebreak.com/git/nozomu/CopyWithLog-python/tree/master/
copy.py
Usage:
copy.py [--symbol] -s <source> -o <mirror>
copy.py [--symbol] -o <mirror> -s <source>
copy.py -h | --help
copy.py --version
Options:
-h -help Show this screen.
-version Show version.
--symbol Make mirror file as symboli link file.
-s Set source file
-o Set mirrored file (or directory)
$ copy.py --symbol -s a.png -o $POSTER/fig1.png
You need to add the directory containing copy.py to $ PATH or write the path.
Copy a.png to $ POSTER / fig1.png and generate (or add) a log file for each. With the --symbol option, the copy file will be generated as a symbolic link.
~, Environment variables (\ $ name, \ $ {name}) are available. If the file name is not specified in \ <mirror > (copy destination) and the directory path is used, A file with the same name as \ <source > will be generated [^ 2].
[^ 2]: If you specify a directory path, it must be closed with a'/' at the end.
logfile: mirror-log.md logfile: source-log.md
[source-log.md]: maked on mirror directory
File name | source-path | copied date
--- | --- | ---
filename | path | date
[mirror-log.md]: maked on source directory
File name | mirror-file-path | copied date
--- | --- | ---
filename | path | date
Generate files mirror-log.md and source-log.md in the copy source and copy destination, respectively. If there are multiple copies, the log will be added. The logs are basically sorted by file name abc (case insensitive).
Basically the copy will be overwritten without warning. Also, even if the same copy source and copy destination are processed multiple times, all the history remains in the log. (File updates are not detected.)
[^ 1]: If there is a Markdown symbol in the directory path, it will look bad, so I may change it.
You may need the ability to manage log files. Currently, even if there is a log file that is meaningless due to the loss of the file It can only be erased manually. That might be a little troublesome.
The source is terrible because I wrote it properly.
Recommended Posts