Thread: Vapoursynth
View Single Post
Old 8th September 2012, 08:59   #62  |  Link
wOxxOm
Oz of the zOo
 
Join Date: May 2005
Posts: 208
There are examples of implementing a case-insensitive dictionary which might work for method names as well if I am not mistaken (here and there):
Code:
class CaseInsensitiveDict(dict):
    def __setitem__(self, key, value):
        super(CaseInsensitiveDict, self).__setitem__(key.lower(), value)

    def __getitem__(self, key):
        return super(CaseInsensitiveDict, self).__getitem__(key.lower())
Other methods should also be redefined in this fashion if being used, like 'contains', 'has_key', etc.

It looks quite easy to incorporate into vapoursynth's avs class, probably even as an optional parameter 'casesens' in vapoursynth.Core() method which would instantiate avs class or avsCaseInsensitive, yet I don't know if and how I can override the avs class from inside my code...

Last edited by wOxxOm; 8th September 2012 at 09:05.
wOxxOm is offline   Reply With Quote