rsgalloway / pyseq

Compressed sequence string module for Python
https://pyseq.rsgalloway.com/
Other
123 stars 36 forks source link

lss -r doesn't show missing frames #54

Closed peppe-russo closed 5 years ago

peppe-russo commented 5 years ago

When running lss with the -r flag it doesn't show missing frames. Example: Running lss (no flags) in a folder with an image sequence with a missing frame you get this result (correct): 417 999_pep_001_comp_logc_v041.%04d.dpx [1001-1402, 1404-1418]

If you run it in the parent directory with the -r flag you get this: . └── 3840x2160 └── 999_pep_001_comp_logc_v041.1001-1418.dpx

While I would expect something like this: . └── 3840x2160 └── 999_pep_001_comp_logc_v041.%04d.dpx [1001-1402, 1404-1418]

rsgalloway commented 5 years ago

HI, thanks for the report. You could use the -f format option to get this behavior, e.g.

$ lss -r tests/ -f "%h%r%t %R"
tests
├── test_pyseq.py 
└── files
    ├── 012_vb_110_v001.1-10.png [1-10]
    ├── 012_vb_110_v002.1-10.png [1-10]
...

But I see what you mean about the inconsistent behavior. The inconsistency is on these two lines:

https://github.com/rsgalloway/pyseq/blob/master/lss#L167 https://github.com/rsgalloway/pyseq/blob/master/lss#L174

Perhaps the reason the -r option does not use the global_format with %R, is for performance. That can be investigated. But, if we were to make these consistent, then the question becomes what should the default format be?

broganross commented 5 years ago

I get the feeling the tree function was written while, or before, the global_format was being added/changed? I remember having a discussion about making it editable by the user, and this could an artifact of that.

rsgalloway commented 5 years ago

Makes sense, looks like these were changed around the same time. Given what is stated in the usage on lss L139, this seems like a bug.

https://github.com/rsgalloway/pyseq/blob/master/lss#L139

So as long as this does not affect performance too much, I think I'll update the default format option to the global_format.

While we're on this subject, there is also a default_format value, which is only used in the Sequence class str method. Should this be changed also?

rsgalloway commented 5 years ago

This is available in the 1.0.0 branch