Example #1
0
    def show_intro(self):
        self._log("<b>This is {} !".format(configuration.get(
            "Globals", "name")))

        self._log("<b>" + copyright())
        self._log("<b>" + license_short())
        self._log("")

        if platform.system() == "Windows" and not isUserAdmin():
            self._log_warning(
                "You don't have amdinistrative rights ! Therefore some of the functionality in this program won't work."
            )
            self._log(
                "To change that, use the 'run as administrator' functionality of Windows. Right-click on the {} admnististration program in the start menu and select 'run as administrator'"
                .format(configuration.get("Globals", "name")))

        if self.check_backup_directory() != True:
            self._log_error("The backup directory is not correct !")
Example #2
0
    def __init__(self, parent):
        super(AboutDialog, self).__init__(parent)

        title = _("About {}...").format(configuration.get("Globals", "name"))
        self.setWindowTitle(title)
        top_layout = QVBoxLayout()
        self.title_widget = TitleWidget(title, self)
        top_layout.addWidget(self.title_widget)

        text = QLabel(u"{}<br/>Version : {}<br/><br/>".format(
            copyright(), str(configuration.this_version)) +
                      _("""This program is given to you with a few important
freedoms and duties as specified in the license below. <b>We believe they will help to make a better world</b>. They are
also <b>legally binding</b> (see Free Software Foundation's website), so make sure you read the license
carefully. We give you the right to
<ul>
<li>run the program,</li>
<li>inspect it to make sure it is safe to use,</li>
<li>modify it to suit your needs,</li>
<li>distribute copies of it,</li>
</ul>
as long as you give those freedoms and duties to anybody you give this program to.
"""))
        text.setTextFormat(Qt.RichText)
        text.setWordWrap(True)
        # text.setMaximumWidth(400)
        top_layout.addWidget(text)

        browser = QTextBrowser()
        browser.setLineWrapMode(QTextEdit.NoWrap)
        browser.setPlainText(license())
        browser.setMinimumWidth(browser.document().documentLayout().
                                documentSize().toSize().width())
        browser.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        top_layout.addWidget(browser)

        self.buttons = QDialogButtonBox()
        self.buttons.addButton(QDialogButtonBox.Ok)

        top_layout.addWidget(self.buttons)
        self.setLayout(top_layout)
        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)
Example #3
0
    def default(self, attr='abc'):
        message = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>
p,h2 {text-align:center; font-family:Verdana; }
table, th, td { border: 1px solid #2900af; border-collapse:collapse; padding:0; margin:0; }
img {background-color:white;}
</style></head>

<body>
   <br/>
   <p><img src="logo.png"/></p>
   <br/>
   <table width="100%" height="1"><tr><td></td><tr/></table><br/><br/>
   <h2>This is the #NAME# download site !</h2>
<p>The current version is <b>{version}</b>.</p>
<p>To download the latest delivery_slips, <a href='/file'>click here</a>.</p>
<br/><br/><br/><br/>
<div style='color:grey'>
<p>#COPYRIGHT#</p>
<p>#LICENSE#</p>
</div>
</body></html>
""".replace("#COPYRIGHT#",
            copyright()).replace("#LICENSE#", license_short()).replace(
                "#NAME#", configuration.get("Globals", "name"))

        try:
            message = message.replace(
                "{version}",
                configuration.get("DownloadSite", "current_version"))
        except Exception as ex:
            pass

        return message
Example #4
0
File: python.py Project: wiz21b/koi
parser.add_argument('--demo', action='store_true', default=False, help='Run as the demo')
parser.add_argument('--screenshots', action='store_true', default=False, help='Make a collection of screenshots')
parser.add_argument('--echo-sql', action='store_true', default=False, help='Show SQL statements')
parser.add_argument('--no-update', action='store_true', default=False, help='Run without trying to update')
# parser.add_argument('--watchdog-file', action='store_true', default="watchdog", help='Watch dog file')
args = parser.parse_args()

if args.dev:
    args.debug = args.console = args.no_update = True

init_logging( console_log=args.console)

if args.debug:
    mainlog.setLevel(logging.DEBUG)

mainlog.info(copyright())
mainlog.info(license_short())

if args.screenshots:
    init_i18n("en_UK")
else:
    init_i18n()

load_configuration()

upgrade_process(args)


# Help cx_freeze
#noinspection PyUnresolvedReferences
import reportlab.graphics.barcode.common