def install_config_form(self):
        """
        This method will be called to build setup configuration form.
        If this plugin needs parameters, provides form fields here.
        Any html and javascript are welcome.
        """
        if self.get_config(self.key_switch)=="no":
            enable_checked  = ""
            disable_checked = "checked"
        else:
            enable_checked  = "checked"
            disable_checked = ""

        result = ""
        result += "<p><strong>%s</strong></p>" % _("Fill this form")
        result += "<blockquote>"
        result += "<dl>"
        result += "\n<dt>"
        result += _("Enable readonly mirror: ")
        result += "\n<dd>"
        result += "<input type='radio' name='switch' value='yes' " + \
                enable_checked  + ">" + _("Enable") + "&nbsp;"
        result += "<input type='radio' name='switch' value='no' " + \
                disable_checked + ">" + _("Disable") + "<br>"
        result += "\n<dt>"
        result += _("Svnsync administrator: ")
        result += "\n<dd>"
        result += "<input type='text' name='admin' size='18' value='%s'>" % \
                self.get_config(self.key_admin)
        result += "\n</dl>"
        result += "</blockquote>"
        return result
Example #2
0
    def install_config_form(self):
        """
        This method will be called to build setup configuration form.
        If this plugin needs parameters, provides form fields here.
        Any html and javascript are welcome.
        """
        if self.get_config(self.key_force)=="no":
            enable_checked  = ""
            disable_checked = "checked"
        else:
            enable_checked  = "checked"
            disable_checked = ""

        result = ""
        result += "<p><strong>%s</strong></p>" % _("Fill this form")
        result += "<blockquote>"
        result += "<dl>"
        result += "\n<dt>"
        result += "<input type='radio' name='force' value='yes' " + \
                enable_checked  + ">" + _("Strict mode") + "&nbsp;"
        result += "\n<dd>"
        result += _("Must set svn:eol-style even if CRLF not in text file (in Unix format).")
        result += "\n<dt>"
        result += "<input type='radio' name='force' value='no' " + \
                disable_checked + ">" + _("Loose mode") + "<br>"
        result += "\n<dd>"
        result += _("Permit checkin without svn:eol-style properity if is in Unix file format (no crlf in text file).")
        result += "\n</dl>"
        result += "</blockquote>"
        return result
Example #3
0
    def install_config_form(self):
        """
        This method will be called to build setup configuration form.
        If this plugin needs parameters, provides form fields here.
        Any html and javascript are welcome.
        """
        if self.get_config(self.key_switch)=="no":
            enable_checked  = ""
            disable_checked = "checked"
        else:
            enable_checked  = "checked"
            disable_checked = ""

        result = ""
        result += "<p><strong>%s</strong></p>" % _("Fill this form")
        result += "<blockquote>"
        result += "<dl>"
        result += "\n<dt>"
        result += _("Enable email notify.")
        result += "\n<dd>"
        result += "<input type='radio' name='switch' value='yes' " + \
                enable_checked  + ">" + _("Enable") + "&nbsp;"
        result += "<input type='radio' name='switch' value='no' " + \
                disable_checked + ">" + _("Disable") + "<br>"
        result += "\n<dt>"
        result += _("Input email notify configurations: ")
        result += "\n<dd>"
        result += "<textarea name='config' rows='5' cols='40'>"
        result += html_escape(self.get_config(self.key_config))
        result += "</textarea>"
        result += "\n</dl>"
        result += "</blockquote>"
        return result
Example #4
0
    def install_info(self):
        """
        Show configurations if plugin is already installed.
        
        return reStructuredText.
        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
        """
        result = self.description
        if self.enabled():
            result += "\n\n"
            result += "**" + _("Current configuration") + "**\n\n"
            if self.get_config(self.key_switch) == "yes":
                result += "- " + _("Mirror enabled.")
            else:
                result += "- " + _("Mirror disabled.")
            result += "\n"
            username = self.get_config(self.key_username)
            if username:
                result += "- " + _("Svnsync username:"******" ``" + username + "``"
            result += "\n"
            urls = self.get_config(self.key_urls)
            if urls:
                result += "- " + _("Url of downstream svn mirrors:") + "\n\n"
                for url in urls.split(';'):
                    result += "  * ``" + url + "``" + "\n"
            if self.get_config(self.key_debug) == "yes":
                result += "- debug on\n"

        return result
Example #5
0
    def install_config_form(self):
        """
        This method will be called to build setup configuration form.
        If this plugin needs parameters, provides form fields here.
        Any html and javascript are welcome.
        """
        if self.get_config(self.key_switch)=="no":
            enable_checked  = ""
            disable_checked = "checked"
        else:
            enable_checked  = "checked"
            disable_checked = ""

        if self.get_config(self.key_debug)=="yes":
            enable_debug = "checked"
            disable_debug = ""
        else:
            enable_debug = ""
            disable_debug = "checked"

        result = ""
        result += "<p><strong>%s</strong></p>" % _("Fill this form")
        result += "<blockquote>"
        result += "<dl>"
        result += "\n<dt>"
        result += _("Enable svn repo mirror: ")
        result += "\n<dd>"
        result += "<input type='radio' name='switch' value='yes' " + \
                enable_checked  + ">" + _("Enable") + "&nbsp;"
        result += "<input type='radio' name='switch' value='no' " + \
                disable_checked + ">" + _("Disable") + "<br>"
        result += "\n<dt>"
        result += _("Svnsync username:"******"\n<dd>"
        result += "<input type='text' name='username' size='18' value='%s'>" % \
                self.get_config(self.key_username)
        result += "\n<dt>"
        result += _("Svnsync password:"******"\n<dd>"
        result += "<input type='password' name='password' size='18' value='%s'>" % \
                self.get_config(self.key_password)
        result += "\n<dt>"
        result += _("Url of downstream svn mirrors:")
        result += "\n<dd>"
        result += "<textarea name='urls' rows='3' cols='40'>"
        result += html_escape( "\n".join( self.get_config(self.key_urls).split(';') ) )
        result += "</textarea>"
        result += "\n<dt>"
        result += _("Debug: ")
        result += "\n<dd>"
        result += "<input type='radio' name='debug' value='yes' " + \
                enable_debug  + ">" + _("Enable") + "&nbsp;"
        result += "<input type='radio' name='debug' value='no' " + \
                disable_debug + ">" + _("Disable") + "<br>"

        result += "\n</dl>"
        result += "</blockquote>"
        return result
Example #6
0
 def install(self, params=None):
     """
     Install hooks-plugin from repository.
     Simply call 'set_config()' and 'save()'.
     
     Form fields in setup_config() will pass as params.
     """
     switch = params.get('switch', 'yes')
     if switch != 'yes':
         switch = 'no'
     config = params.get('config')
     if not config:
         raise Exception, _("Wrong configuration.")
     self.set_config(self.key_switch, switch)
     self.set_config(self.key_config, config)
     self.save()
Example #7
0
    def install_info(self):
        """
        Show configurations if plugin is already installed.
        
        return reStructuredText.
        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
        """
        result = self.description
        if self.enabled():
            result += "\n\n"
            result += "**" + _("Current configuration") + "**\n\n"
            force = self.get_config(self.key_force)
            if force == "no":
                result += "- " + _("Loose mode: permit checkin without svn:eol-style properity if no CRLF in text file.")
            else:
                result += "- " + _("Strict mode: must have svn:eol-style even if not CRLF in text file.")

        return result
Example #8
0
    def install_info(self):
        """
        Show configurations if plugin is already installed.
        
        return reStructuredText.
        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
        """
        result = self.description
        if self.enabled():
            result += "\n\n"
            result += "**" + _("Current configuration") + "**\n\n"
            if self.get_config(self.key_switch) == "yes":
                result += "- " + _("Email notify enabled.")
            else:
                result += "- " + _("Email notify disabled.")
            result += "\n"
            result += "- " + _("Parameters: ") + "``" + self.get_config(self.key_config) + "``\n"

        return result
Example #9
0
    def install_config_form(self):
        """
        This method will be called to build setup configuration form.
        If this plugin needs parameters, provides form fields here.
        Any html and javascript are welcome.
        """
        if self.get_config(self.key_switch) == "no":
            enable_checked = ""
            disable_checked = "checked"
        else:
            enable_checked = "checked"
            disable_checked = ""

        result = ""
        result += "<p><strong>%s</strong></p>" % _("Fill this form")
        result += "<blockquote>"
        result += "\n<dl>"
        result += "\n<dt>"
        result += _("Enable commit log check: ")
        result += "\n<dd>"
        result += "<input type='radio' name='switch' value='yes' " + enable_checked + ">" + _("Enable") + "&nbsp;"
        result += "<input type='radio' name='switch' value='no' " + disable_checked + ">" + _("Disable")
        result += "\n<dt>"
        result += _("Minimal size of commit log: ")
        result += "\n<dd>"
        result += "<input type='text' name='size' size='5' value=\"%s\">" % html_escape(self.get_config(self.key_size))
        result += "\n<dt>"
        result += _("Pattern which commit log must match against: ")
        result += "\n<dd>"
        result += "<textarea name='permit' rows='3' cols='40'>"
        result += html_escape(self.get_config(self.key_permit))
        result += "</textarea>"
        result += "\n<dt>"
        result += _("Pattern which commit log must <b>NOT</b> match against: ")
        result += "\n<dd>"
        result += "<textarea name='prohibit' rows='3' cols='40'>"
        result += html_escape(self.get_config(self.key_prohibit))
        result += "</textarea>"
        result += "\n</dl>"
        result += "</blockquote>"
        return result
    def install_info(self):
        """
        Show configurations if plugin is already installed.
        
        return reStructuredText.
        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
        """
        result = self.description
        if self.enabled():
            result += "\n\n"
            result += "**" + _("Current configuration") + "**\n\n"
            if self.get_config(self.key_switch) == "yes":
                result += "- " + _("Readonly mirror enabled.")
            else:
                result += "- " + _("Readonly mirror disabled.")
            result += "\n"
            admin = self.get_config(self.key_admin)
            if admin:
                result += "- " + _("Admin user: "******"``" + self.get_config(self.key_admin) + "``"

        return result
Example #11
0
 def install(self, params=None):
     """
     Install hooks-plugin from repository.
     Simply call 'set_config()' and 'save()'.
     
     Form fields in setup_config() will pass as params.
     """
     switch = params.get("switch", "yes")
     if switch != "yes":
         switch = "no"
     size = params.get("size")
     log.debug("size: %s" % size)
     if int(size) < 1:
         raise Exception, _("Commit log size must > 0.")
     permit = params.get("permit")
     prohibit = params.get("prohibit")
     self.set_config(self.key_switch, switch)
     self.set_config(self.key_size, size)
     self.set_config(self.key_permit, permit)
     self.set_config(self.key_prohibit, prohibit)
     self.save()
Example #12
0
    def install_info(self):
        """
        Show configurations if plugin is already installed.
        
        return reStructuredText.
        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
        """
        result = self.description
        if self.enabled():
            result += "\n\n"
            result += "**" + _("Current configuration") + "**\n\n"
            if self.get_config(self.key_switch) == "yes":
                result += "- " + _("Commit log check is enabled.")
            else:
                result += "- " + _("Commit log check is disabled.")
            result += "\n"
            result += "- " + _("Minimal size of commit log: ") + self.get_config(self.key_size)
            result += "\n"
            permit = self.get_config(self.key_permit)
            prohibit = self.get_config(self.key_prohibit)
            if permit:
                result += "- " + _("Pattern which commit log must match against: ") + permit
                result += "\n"
            if prohibit:
                result += "- " + _("Pattern which commit log must **NOT** match against: ") + prohibit
                result += "\n"

        return result
Example #13
0
    def install_config_form(self):
        """
        This method will be called to build setup configuration form.
        If this plugin needs parameters, provides form fields here.
        Any html and javascript are welcome.
        """
        if self.get_config(self.key_switch)=="no":
            enable_checked  = ""
            disable_checked = "checked"
        else:
            enable_checked  = "checked"
            disable_checked = ""

        result = ""
        result += "<p><strong>%s</strong></p>" % _("Fill this form")
        result += "<blockquote>"
        result += "\n<dl>"
        result += "\n<dt>"
        result += _("Enable trac post commit hook: ")
        result += "\n<dd>"
        result += "<input type='radio' name='switch' value='yes' " + \
                enable_checked  + ">" + _("Enable") + "&nbsp;"
        result += "<input type='radio' name='switch' value='no' " + \
                disable_checked + ">" + _("Disable")
        result += "\n<dt>"
        result += _("Trac environment location: ")
        result += "\n<dd>"
        result += "<input type='text' name='trac_env' size='50' value=\"%s\">" % \
                html_escape(self.get_config(self.key_trac_env))
        result += "\n<dt>"
        result += _("Repository name in trac (default is blank): ")
        result += "\n<dd>"
        result += "<input type='text' name='trac_repos_name' size='20' value=\"%s\">" % \
                html_escape(self.get_config(self.key_trac_repos_name))
        result += "\n<dt>"
        result += _("Fixed ticket status (default is closed): ")
        result += "\n<dd>"
        result += "<input type='text' name='trac_fixed_status' size='10' value=\"%s\">" % \
                html_escape(self.get_config(self.key_trac_fixed_status))
        result += "\n</dl>"
        result += "</blockquote>"
        return result
Example #14
0
 def install_info(self):
     """
     Show configurations if plugin is already installed.
     
     return reStructuredText.
     reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
     """
     result = self.description
     if self.enabled():
         result += "\n\n"
         result += "**" + _("Current configuration") + "**\n\n"
         if self.get_config(self.key_switch) == "yes":
             result += "- " + _("Trac post commit hook is enabled.")
         else:
             result += "- " + _("Trac post commit hook is disabled.")
         result += "\n"
         result += "- " + _("Trac environment location: ") + self.get_config(self.key_trac_env)
         result += "\n"
         result += "- " + _("Repository name in trac: ") + self.get_config(self.key_trac_repos_name) or '*default*'
         result += "\n"
         result += "- " + _("Fixed ticket's status: ") + self.get_config(self.key_trac_fixed_status) or '*default*'
         
     return result