From c13e7b0f873e4857f1ce7924c0a72609df3ddca2 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:08:02 +0530 Subject: platform independent library and image paths, flake8 compliant --- src/browser/UserManual.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/browser/UserManual.py') 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() -- cgit From 2eb6697de529a643127599070771a0278e9817b3 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:03:41 +0530 Subject: ported GUI to PyQt5 --- src/browser/UserManual.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/browser/UserManual.py') diff --git a/src/browser/UserManual.py b/src/browser/UserManual.py index 886d88a5..e723680a 100644 --- a/src/browser/UserManual.py +++ b/src/browser/UserManual.py @@ -1,18 +1,18 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets import subprocess import os -class UserManual(QtGui.QWidget): +class UserManual(QtWidgets.QWidget): """ This class opens User-Manual page in new tab of web browser when help button is clicked. """ def __init__(self): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) - self.vlayout = QtGui.QVBoxLayout() + self.vlayout = QtWidgets.QVBoxLayout() manual = 'library/browser/User-Manual/eSim_Manual_2.1.pdf' -- cgit