rsgalloway / pyseq

Compressed sequence string module for Python

Home Page:http://rsgalloway.github.com/pyseq/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lss -r doesn't show missing frames

peppe-russo opened this issue · comments

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]

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?

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.

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?

This is available in the 1.0.0 branch