File: webBrowser.py

package info (click to toggle)
kuttypy 2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,896 kB
  • sloc: python: 58,651; javascript: 14,686; xml: 5,767; ansic: 2,716; makefile: 453; asm: 254; sh: 48
file content (23 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding: utf-8; mode: python; indent-tabs-mode: t; tab-width:4 -*-
print('importing webbrowser')
import os,string,glob

from PyQt5 import QtGui,QtCore,QtWidgets
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage
from PyQt5 import QtWebEngineWidgets



import sys,pkg_resources

class codeBrowser(QWebView):
	def __init__(self,*args,**kwargs):
		super(codeBrowser, self).__init__()
		self.code_path = '.'
		sys.path.append(self.code_path)
		self.showMaximized()
				
	def setFile(self,url):
		newUrl = QtCore.QUrl.fromLocalFile(QtCore.QFileInfo(url).absoluteFilePath())
		print ('SETTING URL',url,newUrl)
		self.setUrl(newUrl)#pkg_resources.resource_filename('eyes_html',url)))