def about(title): try: import pulp except ImportError: pulp_version = "(missing!)" else: pulp_version = pulp.VERSION QMessageBox.information( None, "About", """ <h1>{}</h1> <h3>Version {}</h3> <p>© 2014 Oleh Prypin <<a href="mailto:[email protected]">[email protected]</a>><br/> © 2014 Stefan Walzer <<a href="mailto:[email protected]">[email protected]</a>></p> <p>License: <a href="http://www.gnu.org/licenses/gpl.txt">GNU General Public License Version 3</a></p> Using: <ul> <li>Python {} <li>Qt {} <li>{} {} <li>PuLP {} </ul> """.format(title, __version__, sys.version.split(' ', 1)[0], qt.version_str, qt.module, qt.module_version_str, pulp_version))
def about(title): try: import pulp except ImportError: pulp_version = "(missing!)" else: pulp_version = pulp.VERSION QMessageBox.information(None, "About", """ <h1>{}</h1> <h3>Version {}</h3> <p>© 2014 Oleh Prypin <<a href="mailto:[email protected]">[email protected]</a>><br/> © 2014 Stefan Walzer <<a href="mailto:[email protected]">[email protected]</a>></p> <p>License: <a href="http://www.gnu.org/licenses/gpl.txt">GNU General Public License Version 3</a></p> Using: <ul> <li>Python {} <li>Qt {} <li>{} {} <li>PuLP {} </ul> """.format( title, __version__, sys.version.split(' ', 1)[0], qt.version_str, qt.module, qt.module_version_str, pulp_version ))
def about(): import lxml import cssselect QMessageBox.information(None, "About", u""" <h1>Steam Notifier</h1> <h3>Version {}</h3> <p>(C) 2014-2015 Oleh Prypin <<a href="mailto:[email protected]">[email protected]</a>></p> <p>License: <a href="http://www.gnu.org/licenses/gpl.txt">GNU General Public License Version 3</a></p> Using: <ul> <li>Python {} <li>Qt {}, {} {} <li>lxml {} (cssselect {}) </ul> """.format( __version__, sys.version.split(' ', 1)[0], qt.version_str, qt.module, qt.module_version_str, lxml.etree.__version__, cssselect.__version__ ))
def information(): with open('README.md') as f: s = f.read() s = s.split('\n\n\n')[2].split('\n\n', 1)[1] s = re.sub(r'<(.+?)>', r'<a href="\1">\1</a>', s) s = re.sub(r'\[(.+?)\]\((.+?)\)', r'<a href="\2">\1</a>', s) s = re.sub(r'\*(.+?)\*', r'<i>\1</i>', s) s = s.replace('\n\n', '<p>') QMessageBox.information(None, "Information", "<p>Welcome to <i>Steam Notifier</i>.<p>"+s)
.................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. ..................................................................</code>""".replace("\n","\r") self.find_levels_in_content() fill_levels_button = QPushButton("Simulate Fill Levels") fill_levels_button.clicked.connect(fill_levels) self.layout().addWidget(fill_levels_button) def fetch_ok(self): super(TestDialog,self).fetch_ok() self.plaintext_content.setPlainText(self.webpage_content) if __name__=='__main__': app = QApplication(sys.argv) dialog = TestDialog() if dialog.exec_() == QDialog.Accepted: QMessageBox.information(None, "Selected level", dialog.selected_level_file.read()) else: QMessageBox.information(None, "Selected level", "NONE")
.................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. .................................................................. ..................................................................</code>""".replace( "\n", "\r") self.find_levels_in_content() fill_levels_button = QPushButton("Simulate Fill Levels") fill_levels_button.clicked.connect(fill_levels) self.layout().addWidget(fill_levels_button) def fetch_ok(self): super(TestDialog, self).fetch_ok() self.plaintext_content.setPlainText(self.webpage_content) if __name__ == '__main__': app = QApplication(sys.argv) dialog = TestDialog() if dialog.exec_() == QDialog.Accepted: QMessageBox.information(None, "Selected level", dialog.selected_level_file.read()) else: QMessageBox.information(None, "Selected level", "NONE")