Example #1
0
def good():
    iterable = other_obj = [1, 2, 3]
    total = 0
    for obj in range(len(iterable)):
        total += obj
        yield total
        yield iterable[obj + 1: 2]
        yield iterable[len(obj)]
    for obj in iterable:
        yield iterable[obj - 1]

    for index, obj in enumerate(iterable):
        yield iterable[index]
    for index in range(0, 10):
        yield iterable[index + 1]
    for index in range(10):
        yield iterable[index]
    for index in range(len([1, 2, 3, 4])):
        yield index
    for index in range(len(iterable)):
        yield [1, 2, 3][index]
        yield len([1, 2, 3])
    for index in range(len(iterable)):
        yield other_obj[index]

    from unknown import unknown
    for index in range(unknown(iterable)):
        yield iterable[index]

    for index in range(len(iterable)):
        def test(iterable):
            return iterable[index]
        yield test([1, 2, 3])
Example #2
0
def good():
    iterable = other_obj = [1, 2, 3]
    total = 0
    for obj in range(len(iterable)):
        total += obj
        yield total
        yield iterable[obj + 1: 2]
        yield iterable[len(obj)]
    for obj in iterable:
        yield iterable[obj - 1]

    for index, obj in enumerate(iterable):
        yield iterable[index]
    for index in range(0, 10):
        yield iterable[index + 1]
    for index in range(10):
        yield iterable[index]
    for index in range(len([1, 2, 3, 4])):
        yield index
    for index in range(1, len(iterable)):
        yield index
    for index in range(len(iterable)):
        yield [1, 2, 3][index]
        yield len([1, 2, 3])
    for index in range(len(iterable)):
        yield other_obj[index]

    from unknown import unknown
    for index in range(unknown(iterable)):
        yield iterable[index]

    for index in range(len(iterable)):
        def test(iterable):
            return iterable[index]
        yield test([1, 2, 3])
Example #3
0
    def __init_properties(self, document):
        self.__dict__['__cx'].add_global('window', self)
        self.__dict__['__cx'].add_global('self'  , self)
        self.__dict__['__cx'].execute("window.window = window;")

        self.__dict__['__cx'].add_global('document', document)
        self.__dict__['__cx'].execute("window.document = document;")
        
        self.__dict__['__cx'].add_global('location', document.location)
        self.__dict__['__cx'].execute("window.location = location;")

        self.__dict__['__cx'].add_global("ActiveXObject", ActiveXObject)

        self.__dict__['__cx'].add_global("navigator", Navigator())
        self.__dict__['__cx'].execute("window.navigator = navigator;")
        
        self.__dict__['__cx'].add_global("screen", unknown())
        self.__dict__['__cx'].execute("window.screen = screen;")

        if 'top_window' in self.__dict__['__root'].__dict__:
            if self.__dict__['__referrer']:
                top = self.__dict__['__referrer']
            else:
                top = self.__dict__['__root'].top_window
        else:
            top = self

        self.__dict__['__cx'].add_global("top", top)
        self.__dict__['__cx'].execute("window.top = top;")

        self.__dict__['__cx'].add_global("parent", top)
        self.__dict__['__cx'].execute("window.parent = parent;")

        self.__dict__['__cx'].add_global("history", History(document))
        self.__dict__['__cx'].execute("window.history = history;")

        self.__dict__['__cx'].execute("window.innerWidth = 400;")
        self.__dict__['__cx'].execute("window.innerHeight = 200;")
        self.__dict__['__cx'].execute("window.name = '';")
        
        self.__init_undefined_properties()
Example #4
0
    def __init_properties(self, document):
        self.__dict__['__cx'].add_global('window', self)
        self.__dict__['__cx'].add_global('self'  , self)
        self.__dict__['__cx'].execute("window.window = window;")

        self.__dict__['__cx'].add_global('document', document)
        self.__dict__['__cx'].execute("window.document = document;")
        
        self.__dict__['__cx'].add_global('location', document.location)
        self.__dict__['__cx'].execute("window.location = location;")

        self.__dict__['__cx'].add_global("ActiveXObject", ActiveXObject)

        self.__dict__['__cx'].add_global("navigator", Navigator())
        self.__dict__['__cx'].execute("window.navigator = navigator;")
        
        self.__dict__['__cx'].add_global("screen", unknown())
        self.__dict__['__cx'].execute("window.screen = screen;")

        if 'top_window' in self.__dict__['__root'].__dict__:
            if self.__dict__['__referrer']:
                top = self.__dict__['__referrer']
            else:
                top = self.__dict__['__root'].top_window
        else:
            top = self

        self.__dict__['__cx'].add_global("top", top)
        self.__dict__['__cx'].execute("window.top = top;")

        self.__dict__['__cx'].add_global("parent", top)
        self.__dict__['__cx'].execute("window.parent = parent;")

        self.__dict__['__cx'].add_global("history", History(document))
        self.__dict__['__cx'].execute("window.history = history;")

        self.__dict__['__cx'].execute("window.innerWidth = 400;")
        self.__dict__['__cx'].execute("window.innerHeight = 200;")
        self.__dict__['__cx'].execute("window.name = '';")
        
        self.__init_undefined_properties()
Example #5
0
def good():
    iterable = other_obj = [1, 2, 3]
    total = 0
    for obj in range(len(iterable)):
        total += obj
        yield total
        yield iterable[obj + 1:2]
        yield iterable[len(obj)]
    for obj in iterable:
        yield iterable[obj - 1]

    for index, obj in enumerate(iterable):
        yield iterable[index]
    for index in range(0, 10):
        yield iterable[index + 1]
    for index in range(10):
        yield iterable[index]
    for index in range(len([1, 2, 3, 4])):
        yield index
    for index in range(1, len(iterable)):
        yield index
    for index in range(len(iterable)):
        yield [1, 2, 3][index]
        yield len([1, 2, 3])
    for index in range(len(iterable)):
        yield other_obj[index]

    # pylint: disable=import-outside-toplevel
    from unknown import unknown
    for index in range(unknown(iterable)):
        yield iterable[index]

    for index in range(len(iterable)):

        def test(iterable):
            return iterable[index]  # pylint: disable=cell-var-from-loop

        yield test([1, 2, 3])
Example #6
0
 def __getattr__(self, name):
     if name == 'innerHTML': 
         return self.__parser.html[self.begin:self.end]
     
     return unknown()