Code Monkey home page Code Monkey logo

move2archive's People

Contributors

nbehrnd avatar novoid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

move2archive's Issues

move into the archive appears hindered

Using the current implementation by 2023-06-11, the move of an individual file into the archive directory is dysfunctional. It however is possible (from the CLI) to deposit a stack of multiple files at once into an archive folder.

Again, the log attached below documents an instance of Linux Debian 13/trixie (branch testing) with Python 3.11.4 as provided by the repositories of Debian.

2023-07-14_report_move2archive_02.txt

note: potential pitfall for files with timestamps similar enough

For stamps by date2name about day and time, the current implementation of "common substring" can tap into this stamp. Actually -- extending the script's internal documentation, this already takes place with two files 2023-06-11T12.26.18 Wedding of Paula and John - Guests arriving.jpg and 2023-06-11T13.05.48 Wedding of Paula and John - Ceremony starts.jpg which share the last digit of the seconds; instead of the anticipated pattern of Wedding of Paula and John, the implementation suggests 8 Wedding of Paula and John.

Tests so far did not yield the same error for files where date2name assigned only the day alone.

The attached log reports the findings for the current version of move2archive by 2023-06-11 in an instance of Linux Debian 13/trixie (branch testing) with Python 3.11.4.

2023-07-14_report_move2archive.txt

feature suggestion: implementation of a try/escape clause

Similar to a physical archive, I had to re-use some data of yesterday already stashed by move2archive and intended to clear the space again (now) by move2archvie. While this didn't work for that there already is a file of same name in the current working directory and the archive, there were two other files so far never deposit into the archive:

2022-09-15T17 38 32 -- screenshots

Asking what if: what if move2archive's action would include a try/escape clause to the effect:

  • To prevent accidental lost, files of same name/same hash string in the current working directory and in the archive folder are not moved into the archive. They however
  • allow other files in the same working directory (without match in the archive folder) to be moved into the archive folder.

Maybe to check files to contain the same content based on a hash is safer than a check based on file name if file tags assigned and annotations (appendfilename) of different days differ.

Suggestion: Make timestamp format a little more lenient

Short backstory, I saw your suggestion of the organize tool. It seems pretty powerful, but one side effect was that I ended up with a lot of files in a format like YYYY-M-D, where the leading 0 is dropped for month or day.
It doesn't seem to effect sorting of the files in any way so I don't really mind.
I changed the regexp in my local move2arch like this to allow it to parse those formats too:
\d\d\d\d-[01]\d-[0123]\d ->
\d\d\d\d-[01]?\d-[0123]?\d

add possibility to use it in batch with defaults

I would like to get the opportunity to do m2a --batchmode foo.txt with the default settings so that I get the same result than m2a foo.txt + interactively accept defaults per Return.

So far, I need to specify directories in batch-mode.

A perspective of a less command-line-inclined person - or a journey of struggle

Just my two cents from a perspective of a guy that somewhat knows working in command-line, but it's not my primary area of computer use and file browsing. Also using scripts is not my forte.

  1. I try to invoke m2a --help to see where do you put source directory. But help only mentions target directory. A couple of head scratches later I have a moment of revelation! It probably requires a folder specified right after m2a.

My first attempt - failed:

m2a . --archivepath="G:\My Drive\archive"
ERROR    item "." has got no valid datestamp! Can not process this item.

My second attempt - failed:

m2a *.jpg --archivepath="G:\My Drive\archive"
ERROR    File/Folder "*.jpg" does not exist! Aborting.

Aha! Maybe it doesn't require it at all! Maybe it takes the current path as the source.
Nope - failed:

m2a
ERROR
The archive directory "C:\Users\USER\archive" is not a directory!

Wait, so do I have to create the archive folder myself? Let's try that and see what changes.

m2a
m2a: error: Please add at least one file name as argument

Ahhh, but at least archive is now created.
Ok, it works by giving it specific files. Okay. Let's try:

m2a *png --archivepath="C:\archive"
ERROR    File/Folder "*png" does not exist! Aborting.

Still nope!

I checked that at least one PNG file exists in C:\Users\USER\Downloads\ namely: 2022-12-14T14.42.36 pan tadeusz oversimplified -- book ai.png.
I try to invoke:

m2a *png --archivepath="C:\archive"
ERROR    File/Folder "*png" does not exist! Aborting.

Fuuuu...., well I surrender. Just as a test - let's give it one specific file and cross my fingers.

m2a "C:\Users\USER\Downloads>m2a "2022-12-14T14.42.36 pan tadeusz oversimplified -- book ai.png" --archivepath="C:\archive"

ERROR    Folder for year "C:\archive\2022" does not exist! Aborting.

Oh my god...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.