justinfx/gofileseq

difference in behaviour between pyfileseq/gofileseq

Closed this issue · 2 comments

So this works as I'd expect:

>>> fileseq.FileSequence('/proj/weta/assets/user/frobertson/render/cg/ResumeResume/v252/primary/user_frobertson_ResumeResume_1920x1080_v252.beauty1.2-20#.exr-1')
<FileSequence: '/proj/weta/assets/user/frobertson/render/cg/ResumeResume/v252/primary/user_frobertson_ResumeResume_1920x1080_v252.beauty1.2-20#.exr-1'>

However it returns an error in golang:

package main

import (
	"fmt"
	fileseq "github.com/justinfx/gofileseq/v2"
)

func main() {
	seqStr := "/proj/someplace/assets/user/frobertson/render/cg/ResumeResume/v252/primary/user_frobertson_ResumeResume_1920x1080_v252.beauty1.2-20#.exr-1"
	seq, err := fileseq.NewFileSequence(seqStr)
	if err != nil {
		fmt.Printf("uh oh: %s", err.Error())
	} else {
		fmt.Printf("sequence ok: %s", seq)
	}
}

Result:

uh oh: Failed to parse sequence: /proj/someplace/assets/user/frobertson/render/cg/ResumeResume/v252/primary/user_frobertson_ResumeResume_1920x1080_v252.beauty1.2-20#.exr-1

Example:
https://go.dev/play/p/ngFqVXfGxCg

I've compared the regular expression in pyfilseq and updated the file extension pattern to accept a wider range of characters.

Works great, thanks!