sqlboy/fileseq — pull request #18 by justinfx (2014-12-12 19:29:50+00:00)
Title: Fix broken handling for single-file sequence patterns 

There were recent merges that added extra support for sequence strings that represent a single file, with no padding or frame patterns. While part of the FileSequence class was updated to handle this input, various methods and functionality in the class behaved oddly when interacting with it in that state.
len()/iteration/frameRange/start/end would crash while accessing a NoneType as the FrameSet

If you then set a FrameSet/FrameRange onto that sequence, you would get some mixed behavior.
len would report the length of the FrameSet, but iterating over the FileSequence would produce N of the exact same string, since there is no padding.

These proposed changes address the following:
* Fix crashes when there is no FrameSet on the FileSequence and return a sane value
* Iterating over a FileSequence with no FrameSet *or* no padding characters will yield only one string
* len(fileSequence) on a FileSequence with no FrameSet *or* no padding characters returns 1

If it is actually still desirable produce N elements when iterating (where N == len(seq.frameSet())), then we would instead want to update the frame() method to default to a zfill of 1 when there is no padding, and then allow iter() and len() to produce more elements regardless of the zfill/padding.