Good stuff!

On 8 May 2014 08:55, Matt Estela <[email protected]> wrote:

> Also this.  :)
>
> https://github.com/rsgalloway/pyseq
> On 08/05/2014 5:48 PM, "Risto Jankkila" <[email protected]> wrote:
>
>> That fileseq lib is a lifesaver!
>>
>> Makes me almost sorry that I'm not setting up an ad hoc digital
>> intermediate pipeline at the moment. Thanks!
>>
>> /Risto
>>
>>
>> On Thu, May 8, 2014 at 10:32 AM, Justin Israel <[email protected]>wrote:
>>
>>> Nice link.
>>>
>>> Since its on topic in case anyone is interested,  my coworker wrote a
>>> library for parsing sequences and managing complex ranges,  called fileseq
>>>
>>> https://github.com/sqlboy/fileseq
>>>
>>> Pretty useful stuff that is common at studios
>>>  On May 8, 2014 7:28 PM, "Risto Jankkila" <[email protected]>
>>> wrote:
>>>
>>>> Below is a good thread about using regex to do a similar thing. I found
>>>> the answer by Shane Holloway especially interesting.
>>>>
>>>> http://stackoverflow.com/questions/3926936/how-to-list-an-image-sequence-in-an-efficient-way-numercial-sequence-comparison
>>>>
>>>>
>>>> Cheers,
>>>> Risto
>>>>
>>>>
>>>>
>>>> On Wed, May 7, 2014 at 11:40 AM, Stefan Andersson 
>>>> <[email protected]>wrote:
>>>>
>>>>> Thanks guys!
>>>>> Lot's of information there!
>>>>>
>>>>> regards
>>>>> stefan
>>>>>
>>>>>
>>>>>
>>>>> On Wed, May 7, 2014 at 9:38 AM, Justin Israel 
>>>>> <[email protected]>wrote:
>>>>>
>>>>>> The re.compile() thing is a small optimization where you compile the
>>>>>> pattern ahead of time so that it doesn't have to do it each time you 
>>>>>> reuse
>>>>>> it. The re module actually caches the last 100 patterns anyways, so it 
>>>>>> only
>>>>>> really matters if you have many regular expressions that you are using 
>>>>>> over
>>>>>> and over again.
>>>>>>
>>>>>>
>>>>>> On Wed, May 7, 2014 at 8:35 PM, Stefan Andersson <[email protected]
>>>>>> > wrote:
>>>>>>
>>>>>>> Thanks! Though I can't get my head around those
>>>>>>>
>>>>>>>
>>>>>>> re.compile(r'\d+')
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, May 7, 2014 at 8:06 AM, Marcus Ottosson <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Sorry, I completely missed the part of your questions containing
>>>>>>>> the example. :)
>>>>>>>>
>>>>>>>> # 1. Get all string in a dict together with their version number
>>>>>>>> pattern = re.compile(r'\d+')
>>>>>>>> versions = {}for test in v:
>>>>>>>>     version = pattern.search(test).group()
>>>>>>>>     version = int(version)
>>>>>>>>     versions[version] = test
>>>>>>>> # 2. Sort version numbers and fill up a new list of strings
>>>>>>>> sorted_versions = []for version in sorted(versions):
>>>>>>>>     sorted_versions.append(versions[version])
>>>>>>>> print sorted_versions
>>>>>>>>
>>>>>>>> ['test_v1.ma', 'test_v2.ma' ...]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 7 May 2014 07:51, Marcus Ottosson <[email protected]>wrote:
>>>>>>>>
>>>>>>>>> You could do something like this:
>>>>>>>>>
>>>>>>>>> >>> version = re.search(r'v\d+.nk', 'my_nukeFile_v12.nk').group()>>> 
>>>>>>>>> >>> version'v12.nk'
>>>>>>>>>
>>>>>>>>> At this point, you are guaranteed to always have a ‘v’ infront,
>>>>>>>>> and that it will always end with ‘.nk’. At which point you could
>>>>>>>>>
>>>>>>>>> >>> version = int(version[1:-3])12
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 7 May 2014 07:34, Stefan Andersson <[email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> So here is a though. How would you guys go about to sort
>>>>>>>>>> versioning that has no padding? For instance Nuke always adds 
>>>>>>>>>> v1,v2,v3 etc
>>>>>>>>>> without padding. And some users are used to do that when versioning 
>>>>>>>>>> their
>>>>>>>>>> files. I try and trap most of those things to add padding. But... 
>>>>>>>>>> there is
>>>>>>>>>> always that case when you can't.
>>>>>>>>>>
>>>>>>>>>> v = ["test_v1.ma", "test_v2.ma","test_v11.ma","test_v8.ma","
>>>>>>>>>> test_v10.ma"]
>>>>>>>>>>
>>>>>>>>>> how would you sort and print the last version? In a clever way.
>>>>>>>>>> Right now there is a lot of splitting and sorting for me to get it 
>>>>>>>>>> right.
>>>>>>>>>> But it feels there would be a "smart" way with regex, but I can't 
>>>>>>>>>> get my
>>>>>>>>>> head around how to use that.
>>>>>>>>>>
>>>>>>>>>> regards
>>>>>>>>>> stefan
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Wed, May 7, 2014 at 6:42 AM, Marcus Ottosson <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Just reading up on Pyparsing so I could be off here, but I would
>>>>>>>>>>> actually argue that if a codebase relies heavily enough on strings 
>>>>>>>>>>> (for
>>>>>>>>>>> identification?) that regex no longer cuts it, I would consider 
>>>>>>>>>>> whether or
>>>>>>>>>>> not there is a better way of doing it, and not necessarily turn to 
>>>>>>>>>>> heavier
>>>>>>>>>>> guns in parsing.
>>>>>>>>>>>
>>>>>>>>>>> Again, I could very well be misunderstanding. Does anyone have
>>>>>>>>>>> an example of Pyparsing in action?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On 7 May 2014 00:12, Jeremy YeoKhoo <[email protected]> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Thanks so much Chad, yes I agree. Not many TDs are aware or
>>>>>>>>>>>> understand the necessity of good program design and structure (me
>>>>>>>>>>>> included!) and in this case naming convention! Ill have to have a 
>>>>>>>>>>>> look at
>>>>>>>>>>>> that and apply what I can to my own set of tools that i am 
>>>>>>>>>>>> currently in the
>>>>>>>>>>>> process of creating
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks
>>>>>>>>>>>> -Jeremy
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Sunday, 4 May 2014 20:47:26 UTC+10, Jeremy YeoKhoo wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hey guys,
>>>>>>>>>>>>>
>>>>>>>>>>>>> This should be fairly easy for you guys who know regex. If I
>>>>>>>>>>>>> have a string that I want to enable versioning, so say for an 
>>>>>>>>>>>>> example I
>>>>>>>>>>>>> want to recognize a string if it contains ['v001', 'v002', etc...]
>>>>>>>>>>>>> I have something like this...
>>>>>>>>>>>>>
>>>>>>>>>>>>> remp= re.search('[0-9]+', 'hello_v001')
>>>>>>>>>>>>> print temp.group()
>>>>>>>>>>>>>
>>>>>>>>>>>>> but I dont want it to return when:
>>>>>>>>>>>>> remp= re.search('[0-9]+', 'hello_001')
>>>>>>>>>>>>> print temp.group()
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks
>>>>>>>>>>>>> -Jeremy
>>>>>>>>>>>>>
>>>>>>>>>>>>>  --
>>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>>> Google Groups "Python Programming for Autodesk Maya" group.
>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>>>> it, send an email to
>>>>>>>>>>>> [email protected].
>>>>>>>>>>>>  To view this discussion on the web visit
>>>>>>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/ba398c57-19f8-4096-8524-07f609f1496c%40googlegroups.com<https://groups.google.com/d/msgid/python_inside_maya/ba398c57-19f8-4096-8524-07f609f1496c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>>> .
>>>>>>>>>>>>
>>>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> *Marcus Ottosson*
>>>>>>>>>>> [email protected]
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>> Google Groups "Python Programming for Autodesk Maya" group.
>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>>> it, send an email to
>>>>>>>>>>> [email protected].
>>>>>>>>>>>  To view this discussion on the web visit
>>>>>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOD-0rkPSh1QZrzntoLmk7Fawst3%3DGHWmT5w0Fo0yEgn5Q%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOD-0rkPSh1QZrzntoLmk7Fawst3%3DGHWmT5w0Fo0yEgn5Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>>>> .
>>>>>>>>>>>
>>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Stefan Andersson | Digital Janitor
>>>>>>>>>> social media -> "sanders3d"
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups "Python Programming for Autodesk Maya" group.
>>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>>> send an email to [email protected].
>>>>>>>>>>  To view this discussion on the web visit
>>>>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAKW24e29hZ%3DgrJndzhGxpw1j%2BEgVPc6Oi%2Bdcop5d_DMTwxtxCg%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAKW24e29hZ%3DgrJndzhGxpw1j%2BEgVPc6Oi%2Bdcop5d_DMTwxtxCg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>>> .
>>>>>>>>>>
>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> *Marcus Ottosson*
>>>>>>>>> [email protected]
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Marcus Ottosson*
>>>>>>>> [email protected]
>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to [email protected].
>>>>>>>>  To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB1gRWVdmQW%3DpN83Th9tRfcgpquF135%2BnZw5uHf%3DFSN1g%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB1gRWVdmQW%3DpN83Th9tRfcgpquF135%2BnZw5uHf%3DFSN1g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Stefan Andersson | Digital Janitor
>>>>>>> social media -> "sanders3d"
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>>  To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAKW24e3iNZDGBFTweCyBR%3DfYTFugtM%2BPYf9ZidDuHDDWM4Q-dQ%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAKW24e3iNZDGBFTweCyBR%3DfYTFugtM%2BPYf9ZidDuHDDWM4Q-dQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>>  To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0h9_C7qLE6iy%3DLXtm9U%2BjCRpFEzupFn2zPEG-8FxjO3w%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0h9_C7qLE6iy%3DLXtm9U%2BjCRpFEzupFn2zPEG-8FxjO3w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Stefan Andersson | Digital Janitor
>>>>> social media -> "sanders3d"
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>>  To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAKW24e2TOXcVLf38S8ShKUGsZhZkrE0EWhqyewvLDUjoCKyJ_A%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAKW24e2TOXcVLf38S8ShKUGsZhZkrE0EWhqyewvLDUjoCKyJ_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> -------------------------------------------
>>>> Risto Jankkila
>>>> mob. +44 (0)77 6741 9890 (UK)
>>>> mob. +358 (0)40 5422 625 (FI) <[email protected]>
>>>> [email protected]
>>>> -------------------------------------------
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Python Programming for Autodesk Maya" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>>  To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/python_inside_maya/CA%2B5uDBb4JYMR082LGeyTsjfPkE8p71ouvyB-8Aqa06RnuC-1Rg%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CA%2B5uDBb4JYMR082LGeyTsjfPkE8p71ouvyB-8Aqa06RnuC-1Rg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>>  To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA221ivebO62rR273hVtunU%3DvdX6dj%2BdRW8EyrOFvKRQNw%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA221ivebO62rR273hVtunU%3DvdX6dj%2BdRW8EyrOFvKRQNw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> -------------------------------------------
>> Risto Jankkila
>> mob. +44 (0)77 6741 9890 (UK)
>> mob. +358 (0)40 5422 625 (FI) <[email protected]>
>> [email protected]
>> -------------------------------------------
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CA%2B5uDBZwXBji5MkkW%3DPkeoBy4WoyVE%2BpzEvGBR9V6yukVSxHmQ%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CA%2B5uDBZwXBji5MkkW%3DPkeoBy4WoyVE%2BpzEvGBR9V6yukVSxHmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAGCWdhnjQzcL2k6TBgHEdYkZUgh__Bv5b--L3SmqQEzirpK6FA%40mail.gmail.com<https://groups.google.com/d/msgid/python_inside_maya/CAGCWdhnjQzcL2k6TBgHEdYkZUgh__Bv5b--L3SmqQEzirpK6FA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODnsO7XMBQesr-k_fP1A0xKA0u-3Z9oJzxqmvEfOpYmiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to