func (s *FileSequence) Format(tpl string) (string, error) {
	c := map[string]interface{}{
		"dir":      s.Dirname,
		"base":     s.Basename,
		"ext":      s.Ext,
		"startf":   s.Start,
		"endf":     s.End,
		"len":      s.Len,
		"pad":      s.Padding,
		"zfill":    s.ZFill,
		"frange":   s.FrameRange,
		"inverted": s.InvertedFrameRange,
	}

	t, err := template.New("sequence").Funcs(c).Parse(tpl)
	if err != nil {
		return "", err
	}
	var buf bytes.Buffer
	err = t.Execute(&buf, c)
	if err != nil {
		return "", err
	}
	return buf.String(), nil
}
func (s *FileSequence) Format(tpl string) (string, error) {
	c := map[string]interface{}{
		"dir":      s.Dirname,
		"base":     s.Basename,
		"ext":      s.Ext,
		"startf":   s.Start,
		"endf":     s.End,
		"len":      s.Len,
		"pad":      s.Padding,
		"zfill":    s.ZFill,
		"frange":   s.FrameRange,
		"inverted": s.InvertedFrameRange,
	}

	t, err := template.New("sequence").Funcs(c).Parse(tpl)
	if err != nil {
		return "", err
	}
	var buf bytes.Buffer
	err = t.Execute(&buf, c)
	if err != nil {
		return "", err
	}
	return buf.String(), nil
}
/*
Format returns the file sequence as a formatted string according to
the given template.

Utilizes Go text/template format syntax.  Available functions include:
    dir      - the directory name.
    base     - the basename of the sequence (leading up to the frame range).
    ext      - the file extension of the sequence including leading period.
    startf   - the start frame.
    endf     - the end frame.
    len      - the length of the frame range.
    pad      - the detected padding characters (i.e. # , @@@ , ...).
    frange   - the frame range.
    inverted - the inverted frame range. (returns empty string if none)
    zfill    - the int width of the frame padding

Example:

	{{dir}}{{base}}{{frange}}{{pad}}{{ext}}

*/