# Mock imports from Meta class PyQt5: class QtCore: pass class QtGui: pass sys.modules['PyQt5'] = PyQt5 sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'src')) from dsrlib.meta import Meta project = Meta.appName() copyright = '2020-2021, %s' % Meta.appAuthor() author = Meta.appAuthor() # The short X.Y version version = '%d.%d' % Meta.appVersion()[:2] # The full version, including alpha/beta/rc tags release = str(Meta.appVersion()) # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
def __init__(self, parent): super().__init__(parent) self.setWindowTitle( _('{appname} v{appversion}').format(appname=Meta.appName(), appversion=str( Meta.appVersion()))) iodev = QtCore.QFile(':/about.html') iodev.open(iodev.ReadOnly) try: about = bytes(iodev.readAll()).decode('utf-8') finally: iodev.close() about = about.format(author=Meta.appAuthor()) text = QtWidgets.QTextBrowser(self) text.setHtml(about) text.setOpenExternalLinks(True) btn = QtWidgets.QPushButton(_('Done'), self) bld = LayoutBuilder(self) with bld.vbox() as vbox: vbox.addWidget(text) with bld.hbox() as buttons: buttons.addStretch(1) buttons.addWidget(btn) btn.clicked.connect(self.accept) self.resize(800, 600)