Exemplo n.º 1
0
class AptOfflineQtAbout(QtWidgets.QDialog):
    def __init__(self, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.ui = Ui_AboutAptOffline()
        self.ui.setupUi(self)
        self.setupLicense()

    def setupLicense(self):
        ''' LICENSE is looked for in - 
                1. Current directory (dev / possibly windows)
                2. /usr/local/share/doc/apt-offline (source install)
                3. /usr/share/doc/apt-offline (package install)
                
            TODO: to resolve location on window
        '''
        filename = 'LICENSE'
        locations = [
            '.', '/usr/local/share/doc/apt-offline/',
            '/usr/share/doc/apt-offline'
        ]
        for l in locations:
            filepath = os.path.join(l, filename)
            if os.path.isfile(filepath):
                f = open(filepath, "r")
                self.ui.licenseText.setPlainText(f.read())
                f.close()
                return
Exemplo n.º 2
0
class AptOfflineQtAbout(QtGui.QDialog):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_AboutAptOffline()
        self.ui.setupUi(self)
        self.setupLicense()
        
    def setupLicense(self):
        ''' LICENSE is looked for in - 
                1. Current directory (dev / possibly windows)
                2. /usr/local/share/doc/apt-offline (source install)
                3. /usr/share/doc/apt-offline (package install)
                
            TODO: to resolve location on window
        '''
        filename = 'LICENSE'
        locations = ['.', '/usr/local/share/doc/apt-offline/', '/usr/share/doc/apt-offline']
        for l in locations:
            filepath = os.path.join(l,filename)
            if os.path.isfile(filepath):
                f = open(filepath,"r")
                self.ui.licenseText.setPlainText(f.read())
                f.close()
                return
Exemplo n.º 3
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.ui = Ui_AboutAptOffline()
     self.ui.setupUi(self)
     self.setupLicense()