def __safe_call__(self):
        box = CTK.Box()
        pre = "tmp!market!install"
        root = CTK.cfg.get_val('%s!root' % (pre))
        path = os.path.join(root, 'wp-es')

        # If only default language present, skip stage
        if not os.path.isdir(path):
            box += CTK.RawHTML(
                js=CTK.DruidContent__JS_to_goto(box.id, URL_DATABASE))
            return box.Render().toStr()

        table = CTK.PropsTable()
        table.Add(
            _('Language'),
            CTK.ComboCfg('%s!wordpress!lang' % (pre), OPTS_LANG, {
                'class': 'noauto',
                'selected': 'en'
            }), _(LANG_NOTE))

        submit = CTK.Submitter(URL_APPLY)
        submit += table
        submit.bind('submit_success',
                    CTK.DruidContent__JS_to_goto(table.id, URL_DATABASE))

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        buttons += CTK.DruidButton_Submit(_('Next'), do_close=False)

        box = CTK.Box()
        box += CTK.RawHTML('<h2>%s</h2>' % (LANG_H2))
        box += CTK.RawHTML('<p>%s</p>' % (LANG_P1))
        box += submit
        box += buttons
        return box.Render().toStr()
Beispiel #2
0
    def __call__(self):
        commands = []

        for app in CTK.cfg.keys('tmp!market!maintenance!remove'):
            # Should it be deleted?
            delete = CTK.cfg.get_val(
                'tmp!market!maintenance!remove!%s!del' % (app), 0)
            if not int(delete):
                continue

            # Build the command list
            name = CTK.cfg.get_val('tmp!market!maintenance!remove!%s!name' %
                                   (app))
            date = CTK.cfg.get_val('tmp!market!maintenance!remove!%s!date' %
                                   (app))

            entry = {}
            entry['description'] = _("Removing %(name)s (%(date)s)" %
                                     (locals()))
            entry['function'] = lambda app=app: _remove_app(app)

            commands += [entry]

        cont = CTK.Container()
        cont += CTK.RawHTML("<h2>%s</h2>" % (_("Removing Applications")))
        cont += CommandProgress.CommandProgress(commands,
                                                URL_MAINTENANCE_FINISHED)

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        cont += buttons

        return cont.Render().toStr()
    def __safe_call__(self):
        box = CTK.Box()
        box += CTK.RawHTML('<h2>%s</h2>' % (_("Checking Dependencies")))

        error_cc = tools.check_cc()
        error_py = python.detect_python("2.5.0", or_greater=True)
        error_xml = tools.check_xml2config()

        if error_cc:
            note, inst = error_cc
        elif error_py:
            note, inst = error_py
        elif error_xml:
            note, inst = error_xml
        else:
            box += CTK.RawHTML(
                js=CTK.DruidContent__JS_to_goto(box.id, URL_TARGET))
            return box.Render().toStr()

        box += market.Util.InstructionBox(_(note), inst)
        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        buttons += CTK.DruidButton_Goto(_('Retry'),
                                        URL_PRECONDITION,
                                        do_submit=True)
        return box.Render().toStr()
Beispiel #4
0
    def __call__(self):
        application_id = CTK.request.url.split('/')[-1]

        # Build the content
        submit = CTK.Submitter(URL_REPORT_APPLY)
        submit += CTK.TextArea({
            'name': 'report',
            'rows': 10,
            'cols': 60,
            'class': 'noauto'
        })
        submit += CTK.Hidden('app_id', application_id)
        submit.bind('submit_fail',
                    CTK.DruidContent__JS_to_goto(submit.id, URL_REPORT_FAIL))
        submit.bind('submit_success',
                    CTK.DruidContent__JS_to_goto(submit.id, URL_REPORT_OK))

        cont = CTK.Container()
        cont += CTK.RawHTML("<h2>%s</h2>" % (_(NOTE_REPORT_H2)))
        cont += CTK.RawHTML("<p>%s</p>" % (_(NOTE_REPORT_EXPLAIN)))
        cont += CTK.RawHTML("<p>%s</p>" % (_(NOTE_REPORT_COMMENT)))
        cont += submit

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Submit(_("Report"))
        buttons += CTK.DruidButton_Close(_("Cancel"))
        cont += buttons

        return cont.Render().toStr()
Beispiel #5
0
    def __safe_call__(self):
        vserver_n = CTK.cfg.get_val('%s!target!vserver_n' %
                                    ('tmp!market!install'))
        pre_vsrv = 'vserver!%s' % (vserver_n)
        replacements = php.figure_php_user(pre_vsrv)

        market.Install_Log.log("Post installation commands")
        commands = [
            ({
                'function': tools.php_installer_replacements,
                'description': _('Communicating DB details.')
            }),
            ({
                'command':
                'chown ${root_user}:${php_group} ${app_root}/statusnet ${app_root}/statusnet/avatar ${app_root}/statusnet/background ${app_root}/statusnet/file'
            }),
        ]

        progress = market.CommandProgress.CommandProgress(
            commands, market.Install.URL_INSTALL_DONE)
        progress['php_group'] = replacements['php_group']

        box = CTK.Box()
        box += CTK.RawHTML('<h2>%s</h2>' % (_('Performing adjustments')))
        box += CTK.RawHTML(
            '<p>%s</p>' %
            (_('This process may take a while. Please, hold on.')))
        box += progress

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        box += buttons

        return box.Render().toStr()
Beispiel #6
0
    def __safe_call__(self):
        box = CTK.Box()
        box += CTK.RawHTML('<h2>%s</h2>' % (_("Checking Dependencies")))

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        buttons += CTK.DruidButton_Goto(_('Retry'),
                                        URL_PRECONDITION,
                                        do_submit=True)

        # Check PHP
        php_cgi_bin = php.figure_phpcgi_binary()

        if not php_cgi_bin:
            box += php.PHP_Interpreter_Not_Found_Widget()
            box += buttons
            return box.Render().toStr()

        # Database
        supported_dbs = database.get_supported_dbs(DB_SUPPORTED)
        if not supported_dbs:
            box += database.PreconditionError(DB_SUPPORTED)
            box += buttons
            return box.Render().toStr()

        # PHP modules
        error = tools.check_requirements()
        if error:
            box += InstructionBox(error[0], error[1])
            box += buttons
            return box.Render().toStr()

        box += CTK.RawHTML(js=CTK.DruidContent__JS_to_goto(box.id, URL_TARGET))
        return box.Render().toStr()
Beispiel #7
0
    def __safe_call__(self):
        box = CTK.Box()
        box += CTK.RawHTML('<h2>%s</h2>' % (_("Checking Requirements")))

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        buttons += CTK.DruidButton_Goto(_('Retry'),
                                        URL_PRECONDITION,
                                        do_submit=True)

        # Check PHP
        php_cgi_bin = php.figure_phpcgi_binary()

        if not php_cgi_bin:
            box += php.PHP_Interpreter_Not_Found_Widget()
            box += buttons
            return box.Render().toStr()

        # Database
        supported_dbs = database.get_supported_dbs(DB_SUPPORTED)
        if not supported_dbs:
            box += database.PreconditionError(DB_SUPPORTED)
            box += buttons
            return box.Render().toStr()

        # Check PHP modules
        error = tools.check_modules()
        if error:
            note, instructions = error
            box += market.Util.InstructionBox(note,
                                              instructions,
                                              bin_path=php_cgi_bin)
            box += buttons
            return box.Render().toStr()

        # Check PHP settings
        setting_errors = tools.check_settings()
        if setting_errors:
            box += CTK.RawHTML('<p>%s</p>' % (_(
                "Some of your PHP settings do not meet Vanilla's requirements. Please edit your PHP configuration files and try again."
            )))
            table = CTK.Table({'class': 'infosection'})
            table.set_header(1)
            table += [
                CTK.RawHTML(x)
                for x in ('%s ' % _('Setting'), '%s ' % _('Expected value'),
                          _('Current value'))
            ]
            for setting_test in setting_errors:
                table += [CTK.RawHTML(str(x)) for x in setting_test]

            box += CTK.Indenter(table)
            box += buttons
            return box.Render().toStr()

        box += CTK.RawHTML(js=CTK.DruidContent__JS_to_goto(box.id, URL_TARGET))
        return box.Render().toStr()
Beispiel #8
0
    def __call__(self):
        cont = CTK.Container()
        cont += CTK.RawHTML("<h1>%s</h1>" % (_('Report sent successfully')))
        cont += CTK.RawHTML("<p>%s</p>" % (_(NOTE_REPORT_THANKS)))

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Close'))
        cont += buttons

        return cont.Render().toStr()
Beispiel #9
0
    def __call__(self):
        cont = CTK.Container()
        cont += CTK.RawHTML("<h1>%s</h1>" % (_('Could not send the report')))
        cont += CTK.RawHTML("<p>%s</p>" % (_(NOTE_REPORT_ERROR)))
        cont += CTK.RawHTML("<p>%s</p>" % (_(NOTE_REPORT_TIPS)))

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Close'))
        cont += buttons

        return cont.Render().toStr()
    def __safe_call__(self):
        box = CTK.Box()
        details = Wiki_Details()
        details.bind('submit_success',
                     CTK.DruidContent__JS_to_goto(box.id, URL_INSTALLER_3))

        box += CTK.RawHTML('<h2>%s</h2>' % (_("Wiki details")))
        box += details

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Cancel'))
        buttons += CTK.DruidButton_Submit(_('Next'), do_close=False)
        box += buttons

        return box.Render().toStr()
Beispiel #11
0
    def __call__(self):
        cont = CTK.Container()
        cont += CTK.RawHTML("<h1>%s</h1>" % (_('Could not send the review')))
        cont += CTK.RawHTML(
            "<p>%s</p>" %
            (_('We are sorry, but the review could not be sent.')))
        cont += CTK.RawHTML("<p>%s</p>" % (_(
            'Make sure you are logged in and there are no connectivity issues. If the problem persists, please contact our support team.'
        )))

        buttons = CTK.DruidButtonsPanel()
        buttons += CTK.DruidButton_Close(_('Close'))
        cont += buttons

        return cont.Render().toStr()