Comments (4)
En route to extend the test script's scope (there is revised deposit in the pull request), the scene is more complex than anticipated earlier.
- Xubuntu 20.04.2 LTS/Fossa, live image with addition of pytest for Python3 (Python 3.8.5, bash 5.0.17(1)): no problem to run appendfilename on any of the three test files
2022-01-07T18.48_test.txt
,2022-01-07_test.txt
, ortest.txt
manually on the CLI, no problem to run all the automated tests. To select only those about--smart-prepend
, either one of the two instructions below work well:
pytest-3 test_appendfilename.py -m "smart"
pytest-3 test_appendfilename.py -m "smart" -v # a more verbose report to the CLI
- Debian 12/bookworm, branch testing: Testing via test script (same instructions as for Xubuntu 20.04.2 LTS/Fossa) works without a problem. Only the direct.manual interaction on the CLI is inconsistent for either one of the two with date2name's default /
--withtime
time stamp. Perhaps the appendfilename's log when in the verbose mode helps to narrow the cause? If relevant, this session with Python 3.9.9 and bash 5.1.12.
norwid@carnot2:~/Desktop/test_debian$ appendfilename 2022-01-07_ping.txt --smart-prepend -t echo --verbose
DEBUG 2022-01-07 11:51:56,593 text found: [echo]
DEBUG 2022-01-07 11:51:56,593 extracting list of files ...
DEBUG 2022-01-07 11:51:56,593 len(args) [1]
DEBUG 2022-01-07 11:51:56,593 1 filenames found: [2022-01-07_ping.txt]
DEBUG 2022-01-07 11:51:56,593 iterate over files ...
DEBUG 2022-01-07 11:51:56,594 date/time-stamp found, insert text between date/time-stamp and rest
ERROR 2022-01-07 11:51:56,594 Error while trying to build new filename: <class 'TypeError'>
ERROR 2022-01-07 11:51:56,594 1 error(s) occurred. Please check output above.
norwid@carnot2:~/Desktop/test_debian$ ls
2022-01-07_ping.txt 2022-01-07T11.48.38_ping.txt 'echo ping.txt'
from appendfilename.
Hi @nbehrnd,
Unfortunately, I can't reproduce the issue at my side and the debug output is not showing me something that helps me here.
I just committed a more verbose debug output for that use-case. For comparison, this is my output:
vk@sting ..lename/manualtests/2022-01-07-issue-13 (git)-[master] % appendfilename 2022-01-07_ping.txt --smart-prepend -t echo --verbose --dryrun
DEBUG 2022-01-07 17:04:35,268 text found: [echo]
DEBUG 2022-01-07 17:04:35,268 extracting list of files ...
DEBUG 2022-01-07 17:04:35,268 len(args) [1]
DEBUG 2022-01-07 17:04:35,268 1 filenames found: [2022-01-07_ping.txt]
DEBUG 2022-01-07 17:04:35,269 iterate over files ...
DEBUG 2022-01-07 17:04:35,269 options.smartprepend is set with ||echo| |2022-01-07_ping|.txt
DEBUG 2022-01-07 17:04:35,269 options.smartprepend is set with |<class 'str'>|<class 'str'>|<class 'str'>|<class 'str'>|<class 'str'>
DEBUG 2022-01-07 17:04:35,269 date/time-stamp found, insert text between date/time-stamp and rest
DEBUG 2022-01-07 17:10:30,808 options.smartprepend is set with ||2022-01-07|ping.txt|
DEBUG 2022-01-07 17:10:30,808 options.smartprepend is set with |<class 'str'>|<class 'str'>|<class 'str'>|
DEBUG 2022-01-07 17:10:30,808 new_filename is now: 2022-01-07 echo ping.txt
INFO 2022-01-07 17:04:35,269
INFO 2022-01-07 17:04:35,269 renaming "2022-01-07_ping.txt"
INFO 2022-01-07 17:04:35,269 ⤷ "2022-01-07 echo ping.txt"
DEBUG 2022-01-07 17:04:35,269 successfully finished.
Please press <Enter> for finishing...
vk@sting ..lename/manualtests/2022-01-07-issue-13 (git)-[master] %
Can you please re-run your test and post here the output? Thank you very much!
from appendfilename.
By observation, now the manual conversion works (both on Xubuntu 20.04.2 LTS Fossa, as well as on Debian 12/book worm [testing]). Conceptually, the extended log to the CLI matches yours:
norwid@carnot2:~/Desktop/2022-01-07T18.51.32_appendfilename/appendfilename/appendfilename$ python __init__.py 2022-01-07_ping.txt --smart-prepend -t echo --verbose --dryrun
DEBUG 2022-01-07 19:12:09,498 text found: [echo]
DEBUG 2022-01-07 19:12:09,498 extracting list of files ...
DEBUG 2022-01-07 19:12:09,499 len(args) [1]
DEBUG 2022-01-07 19:12:09,499 1 filenames found: [2022-01-07_ping.txt]
DEBUG 2022-01-07 19:12:09,499 iterate over files ...
DEBUG 2022-01-07 19:12:09,499 options.smartprepend is set with ||echo| |2022-01-07_ping|.txt
DEBUG 2022-01-07 19:12:09,499 options.smartprepend is set with |<class 'str'>|<class 'str'>|<class 'str'>|<class 'str'>|<class 'str'>
DEBUG 2022-01-07 19:12:09,499 date/time-stamp found, insert text between date/time-stamp and rest
DEBUG 2022-01-07 19:12:09,499 options.smartprepend is set with ||2022-01-07|ping.txt|
DEBUG 2022-01-07 19:12:09,499 options.smartprepend is set with |<class 'str'>|<class 'str'>|<class 'str'>|
DEBUG 2022-01-07 19:12:09,499 new_filename is now: 2022-01-07 echo ping.txt
INFO 2022-01-07 19:12:09,499
INFO 2022-01-07 19:12:09,499 renaming "2022-01-07_ping.txt"
INFO 2022-01-07 19:12:09,499 ⤷ "2022-01-07 echo ping.txt"
DEBUG 2022-01-07 19:12:09,500 successfully finished.
Please press <Enter> for finishing...
norwid@carnot2:~/Desktop/2022-01-07T18.51.32_appendfilename/appendfilename/appendfilename$
So, this obstacle is out of the way. Thank you!
from appendfilename.
Weird.
Well, thanks for your effort in any case. Let me know when this reappears. I keep the additional debug code for now.
from appendfilename.
Related Issues (13)
- Optionally removing words from file names HOT 3
- renaming file which is a link to same file name doesn't work recursive
- feature suggest: harmonization of three pattern by date2name HOT 3
- --smart-prepend option behaves like --prepend option when path is absolute
- Thunar integration by GUI HOT 1
- Prepend filename command line switch HOT 3
- Help command line switch HOT 2
- Move constants to dot config file HOT 4
- appendfilename on Windows shortcut does not rename original file
- Tried you geeqie setup in ubuntu 18.04, but terminal window appears and disappears immediately again HOT 4
- --remove option is not available, see your geeqie use case example where you use it HOT 4
- Can we use appendfilename also with _ as delimiter instead of using spaces? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appendfilename.