# import webbrowser
# webbrowser.open_new(r'file:///media/kaiser/Data/uclm/PrimeroMASTER/LAB/lab_book/ROS_Py.pdf')

import os
# os.system('ROS_Py.pdf')

#code generated by QtCreator:
from PySide import QtCore, QtGui
from PySide import QtWebKit
from PySide.QtWebKit import *
from PySide.QtCore import *
import sys
class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1000, 700)
        self.centralWidget = QtGui.QWidget(MainWindow)
        self.centralWidget.setObjectName("centralWidget")
        self.webView = QtWebKit.QWebView(self.centralWidget)
        self.webView.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled, True)
        self.webView = QtWebKit.QWebView(self.centralWidget)
        self.webView.setGeometry(QtCore.QRect(10, 20, 1000, 700))

        fn = os.path.join(os.path.dirname(__file__), 'guia')

        url = fn+"/guia_usuario.html"
        print(url)
        self.webView.load(QUrl(url))
        # QtGui.QDesktopServices.openUrl(url)
        self.webView.setObjectName("webView")
        MainWindow.setCentralWidget(self.centralWidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)


    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "DIRe", None, QtGui.QApplication.UnicodeUTF8))

from PySide import QtWebKit

# My code:
class Visor_documentacion(QtGui.QMainWindow):
    def __init__(self, parent=None):
        super(Visor_documentacion, self).__init__(parent)

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        self.center()

    def center(self):
        qr = self.frameGeometry()
        cp = QtGui.QDesktopWidget().availableGeometry().center()
        qr.moveCenter(cp)
        self.move(qr.topLeft())

if __name__ == "__main__":
    APP = QtGui.QApplication(sys.argv)
    MW = Visor_documentacion()
    MW.show()

    sys.exit(APP.exec_())