Example #1
0
 def __contains__(self, item):
     """Return true if the given Person object is listed in this Movie,
     or if the the given Character is represented in this Movie."""
     from Person import Person
     from Character import Character
     from Company import Company
     if isinstance(item, Person):
         for p in flatten(self.data,
                          yieldDictKeys=1,
                          scalar=Person,
                          toDescend=(ListType, DictType, TupleType, Movie)):
             if item.isSame(p):
                 return 1
     elif isinstance(item, Character):
         for p in flatten(self.data,
                          yieldDictKeys=1,
                          scalar=Person,
                          toDescend=(ListType, DictType, TupleType, Movie)):
             if item.isSame(p.currentRole):
                 return 1
     elif isinstance(item, Company):
         for c in flatten(self.data,
                          yieldDictKeys=1,
                          scalar=Company,
                          toDescend=(ListType, DictType, TupleType, Movie)):
             if item.isSame(c):
                 return 1
     return 0
Example #2
0
 def __contains__(self, item):
     """Return true if the given Person object is listed in this Movie,
     or if the the given Character is represented in this Movie."""
     from .Person import Person
     from .Character import Character
     from .Company import Company
     if isinstance(item, Person):
         for p in flatten(self.data,
                          yieldDictKeys=True,
                          scalar=Person,
                          toDescend=(list, dict, tuple, Movie)):
             if item.isSame(p):
                 return True
     elif isinstance(item, Character):
         for p in flatten(self.data,
                          yieldDictKeys=True,
                          scalar=Person,
                          toDescend=(list, dict, tuple, Movie)):
             if item.isSame(p.currentRole):
                 return True
     elif isinstance(item, Company):
         for c in flatten(self.data,
                          yieldDictKeys=True,
                          scalar=Company,
                          toDescend=(list, dict, tuple, Movie)):
             if item.isSame(c):
                 return True
     elif isinstance(item, str):
         return item in self.data
     return False
Example #3
0
 def __contains__(self, item):
     """Return true if this Person has worked in the given Movie,
     or if the fiven Character was played by this Person."""
     from .Movie import Movie
     from .Character import Character
     if isinstance(item, Movie):
         for m in flatten(self.data, yieldDictKeys=True, scalar=Movie):
             if item.isSame(m):
                 return True
     elif isinstance(item, Character):
         for m in flatten(self.data, yieldDictKeys=True, scalar=Movie):
             if item.isSame(m.currentRole):
                 return True
     return False
Example #4
0
 def __contains__(self, item):
     """Return true if this Person has worked in the given Movie,
     or if the fiven Character was played by this Person."""
     from Movie import Movie
     from Character import Character
     if isinstance(item, Movie):
         for m in flatten(self.data, yieldDictKeys=1, scalar=Movie):
             if item.isSame(m):
                 return 1
     elif isinstance(item, Character):
         for m in flatten(self.data, yieldDictKeys=1, scalar=Movie):
             if item.isSame(m.currentRole):
                 return 1
     return 0
Example #5
0
 def __contains__(self, item):
     """Return true if this Character was portrayed in the given Movie
     or it was impersonated by the given Person."""
     from Movie import Movie
     from Person import Person
     if isinstance(item, Person):
         for m in flatten(self.data, yieldDictKeys=1, scalar=Movie):
             if item.isSame(m.currentRole):
                 return 1
     elif isinstance(item, Movie):
         for m in flatten(self.data, yieldDictKeys=1, scalar=Movie):
             if item.isSame(m):
                 return 1
     return 0
Example #6
0
 def __contains__(self, item):
     """Return true if this Character was portrayed in the given Movie
     or it was impersonated by the given Person."""
     from Movie import Movie
     from Person import Person
     if isinstance(item, Person):
         for m in flatten(self.data, yieldDictKeys=1, scalar=Movie):
             if item.isSame(m.currentRole):
                 return 1
     elif isinstance(item, Movie):
         for m in flatten(self.data, yieldDictKeys=1, scalar=Movie):
             if item.isSame(m):
                 return 1
     return 0
Example #7
0
 def __contains__(self, item):
     """Return true if this company and the given Movie are related."""
     from .Movie import Movie
     if isinstance(item, Movie):
         for m in flatten(self.data, yieldDictKeys=True, scalar=Movie):
             if item.isSame(m):
                 return True
     return False
Example #8
0
 def __contains__(self, item):
     """Return true if this company and the given Movie are related."""
     from Movie import Movie
     if isinstance(item, Movie):
         for m in flatten(self.data, yieldDictKeys=1, scalar=Movie):
             if item.isSame(m):
                 return 1
     return 0
Example #9
0
 def __contains__(self, item):
     """Return true if the given Person object is listed in this Movie,
     or if the the given Character is represented in this Movie."""
     from Person import Person
     from Character import Character
     from Company import Company
     if isinstance(item, Person):
         for p in flatten(self.data, yieldDictKeys=1, scalar=Person,
                         toDescend=(list, dict, tuple, Movie)):
             if item.isSame(p):
                 return 1
     elif isinstance(item, Character):
         for p in flatten(self.data, yieldDictKeys=1, scalar=Person,
                         toDescend=(list, dict, tuple, Movie)):
             if item.isSame(p.currentRole):
                 return 1
     elif isinstance(item, Company):
         for c in flatten(self.data, yieldDictKeys=1, scalar=Company,
                         toDescend=(list, dict, tuple, Movie)):
             if item.isSame(c):
                 return 1
     return 0
Example #10
0
 def set_objects_params(self, data):
     """Set parameters of Movie/Person/... instances, since they are
     not always set in the parser's code."""
     for obj in flatten(data, yieldDictKeys=True, scalar=_Container):
         obj.accessSystem = self._as
         obj.modFunct = self._modFunct
Example #11
0
 def set_objects_params(self, data):
     """Set parameters of Movie/Person/... instances, since they are
     not always set in the parser's code."""
     for obj in flatten(data, yieldDictKeys=True, scalar=_Container):
         obj.accessSystem = self._as
         obj.modFunct = self._modFunct