Пример #1
0
    def __init__(self,
                 url,
                 dom_or_doc,
                 navigator=None,
                 personality='winxpie60',
                 name="",
                 target='_blank',
                 parent=None,
                 opener=None,
                 replace=False,
                 screen=None,
                 width=800,
                 height=600,
                 left=0,
                 top=0,
                 **kwds):

        self.url = url
        self.doc = w3c.getDOMImplementation(dom_or_doc, **kwds) if isinstance(
            dom_or_doc, BeautifulSoup.BeautifulSoup) else dom_or_doc

        self.doc.window = self
        self.doc.contentWindow = self
        for p in w3c_bindings:
            setattr(self, p, w3c_bindings[p])

        self._navigator = navigator if navigator else Navigator(
            personality, self)
        self._location = Location(self)
        self._history = History(self)
        self._history.update(url, replace)

        #self.doc.location = self._location
        self.doc.location = property(self.getLocation, self.setLocation)

        self._target = target
        self._parent = parent if parent else self
        self._opener = opener
        self._screen = screen or Screen(width, height, 32)
        self._closed = False

        self._personality = personality
        self.__init_personality()

        self.name = name
        self.defaultStatus = ""
        self.status = ""
        self._left = left
        self._top = top
        self.innerWidth = width
        self.innerHeight = height
        self.outerWidth = width
        self.outerHeight = height
        self.timers = []
        self.java = java()

        self._symbols = set()
        self._methods = tuple()

        log.MIMEHandler.window = self
Пример #2
0
    def __init__(self, url, dom_or_doc, navigator = None, personality = 'winxpie60', name="",
                 target='_blank', parent = None, opener = None, replace = False, screen = None,
                 width = 800, height = 600, left = 0, top = None, **kwds):

        self.url = url
        self.doc = w3c.getDOMImplementation(dom_or_doc, **kwds) if isinstance(dom_or_doc, BeautifulSoup.BeautifulSoup) else dom_or_doc

        self.doc.window        = self
        self.doc.contentWindow = self

        for p in w3c_bindings:
            setattr(self, p, w3c_bindings[p])

        self._navigator = navigator if navigator else Navigator(personality, self)
        self._location  = Location(self)
        self._history   = parent.history if parent and parent.history else History(self)

        if url not in ('about:blank', ):
            self._history.update(url, replace)

        self.doc.location = property(self.getLocation, self.setLocation)

        self._target = target
        self._parent = parent if parent else self
        self._opener = opener
        self._screen = screen or Screen(width, height, 32)
        self._closed = False

        self._personality = personality
        self.__init_personality()

        self.name          = name
        self.defaultStatus = ""
        self.status        = ""
        self._left         = left
        self._top          = top if top else self
        self._screen_top   = random.randint(0, 30)
        self.innerWidth    = width
        self.innerHeight   = height
        self.outerWidth    = width
        self.outerHeight   = height
        self.timers        = []
        self.java          = java()

        self._symbols      = set()
        self._methods      = tuple()

        log.MIMEHandler.window = self
Пример #3
0
def test_java():
    obj_java = java()
    assert isinstance(obj_java.lang, lang)