Closed egh closed 3 years ago
I was wrong - it's not reading an old version, it's reading the wrong file.
I had a look at the code and I think the core problem is that, for some reason, my file indexes are not aligned with the space
value. I made a small change
diff --git a/neotools/file.py b/neotools/file.py
index c36716b..76a4130 100644
--- a/neotools/file.py
+++ b/neotools/file.py
@@ -169,7 +169,7 @@ def list_files(device, applet_id):
files.append(attrs)
logger.debug('file listed file_index=%s attrs=%s', file_index, attrs)
file_index = file_index + 1
- files = sorted(files, key=lambda f: f.space)
+ # files = sorted(files, key=lambda f: f.space)
return files
And you can see the files are out of order:
But the read code assumes that space
is the same as index. (There is also a file at space 0, which the code assumes is impossible?) So the behavior I am seeing is that:
neotools read file 8
At least, that is what seems to me to be happening.
Thank you for the PR. I also pushed a few more small improvements on top of your fix. Can you try out the recent master for a few days and see if there are any issues? If everything's fine, I'll release it.
Can you try out the recent master for a few days and see if there are any issues?
Absolutely! Thanks for you work on this.
Thanks so much for this tool! It seems like a much better solution than sending via the keyboard, which is quite slow.
However, I am finding that when attempting to read the text in file 8, I am getting an old version.
I'll look into the issue more, but I was curious if you had any ideas.