summaryrefslogtreecommitdiff
path: root/src/browser
diff options
context:
space:
mode:
authorrahulp132020-07-24 01:08:02 +0530
committerrahulp132020-07-24 01:08:02 +0530
commitc13e7b0f873e4857f1ce7924c0a72609df3ddca2 (patch)
tree119f73a57ec709c494b2c9e34cf309e2619008c7 /src/browser
parent175208c2553bde875968a9bc53176b6039ba9360 (diff)
downloadeSim-c13e7b0f873e4857f1ce7924c0a72609df3ddca2.tar.gz
eSim-c13e7b0f873e4857f1ce7924c0a72609df3ddca2.tar.bz2
eSim-c13e7b0f873e4857f1ce7924c0a72609df3ddca2.zip
platform independent library and image paths, flake8 compliant
Diffstat (limited to 'src/browser')
-rw-r--r--src/browser/UserManual.py14
-rw-r--r--src/browser/Welcome.py9
2 files changed, 14 insertions, 9 deletions
diff --git a/src/browser/UserManual.py b/src/browser/UserManual.py
index f31af29d..886d88a5 100644
--- a/src/browser/UserManual.py
+++ b/src/browser/UserManual.py
@@ -1,6 +1,5 @@
from PyQt4 import QtGui
import subprocess
-import platform
import os
@@ -15,14 +14,15 @@ class UserManual(QtGui.QWidget):
self.vlayout = QtGui.QVBoxLayout()
- file = os.path.realpath(
- 'library/browser/User-Manual/eSim_Manual_2019_Dec_31.pdf'
- )
+ manual = 'library/browser/User-Manual/eSim_Manual_2.1.pdf'
- if 'Win' in platform.system():
- os.startfile(file)
+ if os.name == 'nt':
+ os.startfile(os.path.realpath(manual))
else:
- subprocess.Popen(['xpdf.real', file], shell=False)
+ manual_path = '../../' + manual
+ subprocess.Popen(
+ ['xdg-open', os.path.realpath(manual_path)], shell=False
+ )
self.setLayout(self.vlayout)
self.show()
diff --git a/src/browser/Welcome.py b/src/browser/Welcome.py
index 69584f10..aa7b612f 100644
--- a/src/browser/Welcome.py
+++ b/src/browser/Welcome.py
@@ -1,4 +1,5 @@
from PyQt4 import QtGui, QtCore
+import os
class Welcome(QtGui.QWidget):
@@ -10,10 +11,14 @@ class Welcome(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
self.vlayout = QtGui.QVBoxLayout()
-
self.browser = QtGui.QTextBrowser()
+
+ init_path = '../../'
+ if os.name == 'nt':
+ init_path = ''
+
self.browser.setSource(QtCore.QUrl(
- "library/browser/welcome.html")
+ init_path + "library/browser/welcome.html")
)
self.browser.setOpenExternalLinks(True)
self.browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)