Esempio n. 1
0
def logic_thread():
    # get path to local files
    fpath = os.path.abspath(__file__)
    fpath = os.path.join(os.path.split(fpath)[0], "gui.html")

    # wait until window ready
    while True:
        print 'checking if window ready...'
        if webview.window_exists():
            break
        time.sleep(.1)

    # load gui html file
    print "get_current_url() returns: ", webview.get_current_url()
    webview.load_url(fpath)
    print "get_current_url() returns: ", webview.get_current_url()
Esempio n. 2
0
    def checking2(self, varg='C:/new/fullscreen.png'):
        '''conn = sqlite3.connect('user.db')
        c = conn.cursor()
        c.execute('CREATE TABLE IF NOT EXISTS webstuffs(links TEXT, videos TEXT, photos TEXT)')
        c.executer('INSERT INTO webstuffs(videos) VALUES (?)', (self.browser.ur(),))
        conn.commit()

        print(self.browser.url())'''

        #print(ok)

        ok = webview.get_current_url()
        if len(str(ok)) > 1:

            print('f**k her!')
            conn = sqlite3.connect('user.db')
            c = conn.cursor()

            text2, self.oktext2 = QInputDialog.getText(
                self, 'Input Dialog', 'Name of the photo link:')

            #self.msg.show()
            #elf.tbox.show()

            conn = sqlite3.connect('system info.db')
            c = conn.cursor()
            c.execute('SELECT * FROM dir')
            checks = c.fetchall()
            print(str(checks[-1]))
            for var in checks[-1]:
                varg = str(var) + '/' + str(text2)

            with mss.mss() as sct:
                filename = sct.shot(mon=-1, output=str(varg))
                print(filename)
                # sct.save()
                # print(filename)

                print(str(text2))
                conn = sqlite3.connect('user.db')
                c = conn.cursor()
                c.execute(
                    'CREATE TABLE IF NOT EXISTS webstuffs(links TEXT, videos TEXT, photos TEXT, vidname TEXT, photoname TEXT, vidimg TEXT, imgimg TEXT)'
                )
                c.execute(
                    'INSERT INTO webstuffs(photos, photoname, imgimg) VALUES (?, ?, ?)',
                    (str(ok), str(text2), str(filename)))
                conn.commit()
                self.show()
Esempio n. 3
0
    def get_current_ur(self):
        import webview
        from time import sleep

        webview.create_window(title='ok',
                              url='https://www.bing.com',
                              width=600,
                              height=600,
                              resizable=False,
                              fullscreen=False,
                              min_size=(200, 100),
                              strings={},
                              confirm_quit=False,
                              background_color='#FFF')

        print(webview.get_current_url())
Esempio n. 4
0
def get_current_url():
    print(webview.get_current_url())
 def _get_current_url(webview):
     webview.get_current_url()
Esempio n. 6
0
def no_url_test():
    assert webview.get_current_url() is None
Esempio n. 7
0
def current_url_test():
    assert webview.get_current_url() == 'https://example.org/'
Esempio n. 8
0
def change_url():
    import time
    time.sleep(3)
    webview.load_url("http://www.hao123.com/")
    webview.gui.set_title("nihao","master")
    print(webview.get_current_url())
Esempio n. 9
0
def get_current_url():
    print(webview.get_current_url())
Esempio n. 10
0
def no_url_test():
    assert webview.get_current_url() is None
Esempio n. 11
0
def current_url_test():
    assert webview.get_current_url() == 'https://example.org/'
Esempio n. 12
0
def get_current_url():
    import time
    time.sleep(5)
    print(webview.get_current_url())
Esempio n. 13
0
def get_current_url():
    import time
    time.sleep(5)
    print(webview.get_current_url())