New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding support for optional keys in templates #30
base: master
Are you sure you want to change the base?
Conversation
Thanks for this - will take a look over the weekend. |
Hi Martin, |
Hey, Didn't get as much chance to play with this as I wanted over the weekend. However, here are my current thoughts: As stated in #29, I still feel that putting this behaviour in the template then conflicts with the idea of having multiple templates and that it also makes the logic more complicated (not only in implementation, but also usage). It also leads to the question of when to use multiple templates vs optional keys. I think what might be better is to add this behaviour as a helper / preprocessor instead for those that want it. So given some strings in this format the helper generates the relevant template instances and returns them as a collection, from which best match can then be used. Of course this line of thinking does mean that #18 needs doing! Maybe I am missing something though - what is the driving force behind wanting to reduce the amount of templates considering they can be generated programmatically? |
Hi Martin, one point is I am used of having optional keys in templates :-) Maybe the best match approach is sth I have not givin much thought yet.... What I tend todo with our old system and lucidity already is usually this: If I am having optional keys in there I can use the same template for stereo image sequences, image sequences, movies and stereo movies in projects with an episode or without. So i can leave out an entire naming based matching logic or hardcoding of template names. Or how would you approach sth like this ? Cheers and thanks for looking into this. |
Conflicts: source/lucidity/template.py
Sorry for the delay - I totally missed that you had replied! I understand where you are coming from - I'm just not sure it fits into Lucidity at the Template level. One of the reasons that I avoided supporting reading from config natively in Lucidity is that I felt it more powerful and flexible to be able to manipulate them programatically. I also like how this means that the rest of the logic is very clear and it is simple to work out (and prioritise) which Template is used for which situation later. However, as mentioned, I'm open to adding some helper / preprocessor stuff to Lucidity which would give what you want I think, but just at a higher level than the templates - perhaps linked to reading from config files. Can you send through some concrete examples of your template combinations so I can get more of a feel for what is involved and perhaps give an example of how I might handle it now? |
Hey Martin, sorry for my delay now and thanks for the answer, maybe it would be good to have some other connection to talk about this... Cheers |
Sure! - I've pinged you via email. |
Tests @tkaufmann zum drauf schauen mal ein merge request See merge request !1
Any news on getting this merged? |
Hey, So basically I would want to rework this a bit... though I dont know when .... |
Cool 😄 Look forward to this! |
…hen over this than the hassle of a special return dict
Hello Martin,
this pullrequest is to support optional keys
'{pro}/[{episode}/]{seq}/{shot}'
like this in square brackets.
I dont know whether you favour this at all, but I like the them a lot.
As one can reduce the amount of templates a lot.
let me know what you think.
Cheers
johannes