Changeset 46

Show
Ignore:
Timestamp:
2008年08月27日 22时04分28秒 (4 years ago)
Author:
jiangx
Message:

See #9: plugins refactor; add more hook-plugins

Location:
trunk
Files:
5 added
11 modified

Legend:

Unmodified
Added
Removed
  • trunk/config/Makefile

    r45 r46  
    99        @-rm localconfig.pyc >/dev/null 2>&1 
    1010        @-rm -f *,v RCS/*test,v 2>&1 
     11        @-rm -rf ../svnroot.test 
    1112 
    1213%: $(SRCDIR)/%.in 
  • trunk/pysvnmanager/controllers/repos.py

    r45 r46  
    6767        return msg 
    6868     
    69     def get_remove_hook_form_content(self): 
     69    def get_installed_hook_form(self): 
    7070        reposname = request.params.get('select') 
    7171        h = _hooks.Hooks(self.repos_root + '/' + reposname) 
     
    8787                    'num': num, 'plugin': name, } 
    8888                msg += "</td>\n" 
    89                 msg += "<td>" + name + "</td>\n" 
     89                msg += "<td><a href='#' onclick=\"show_hook_config_form('%s'); return false;\">" % name + name + "</a></td>\n" 
    9090                msg += "<td>" + h.plugins[name].name + "</td>\n" 
    9191                msg += "<td>" + h.plugins[name].get_type() + "</td>\n" 
    9292                msg += "</tr>\n" 
    93                 msg += "<tr><td></td><td colspan='3'>" + h.plugins[name].detail + "</td></tr>\n" 
     93                msg += "<tr><td></td><td colspan='3'>" + h.plugins[name].show_install_info() + "</td></tr>\n" 
    9494                num += 1 
    9595            msg += "</table>\n" 
    96             msg += '<input type="submit" name="remove_hook" value="%s">\n' % _("Remove selected hooks") 
     96            msg += '<input type="submit" name="uninstall_hook" value="%s">\n' % _("Remove selected hooks") 
    9797 
    9898        return msg 
    9999     
    100     def get_hook_form(self): 
     100    def get_hook_setting_form(self): 
    101101        reposname  = request.params.get('repos') 
    102102        pluginname = request.params.get('plugin') 
    103103        h = _hooks.Hooks(self.repos_root + '/' + reposname) 
     104        result  = "<input type='hidden' name='_repos' value='%s'>" % reposname 
     105        result += "<input type='hidden' name='_plugin' value='%s'>" % pluginname 
     106        result +=  h.plugins[pluginname].show_install_config_form() 
    104107 
    105         return h.plugins[pluginname].install_config_form() 
     108        return result 
    106109     
    107     def apply_new_hook(self): 
     110    def setup_hook(self): 
    108111        try: 
    109112            d = request.params 
     
    121124        return result 
    122125     
    123     def remove_hook(self): 
     126    def uninstall_hook(self): 
    124127        plugin_list=[] 
    125128        d = request.params 
  • trunk/pysvnmanager/hooks/plugins/CaseInsensitive.py

    r45 r46  
    77class CaseInsensitive(PluginBase): 
    88 
     9    # Plugin id 
     10    id = __name__.rsplit('.',1)[-1] 
     11     
    912    # Brief name for this plugin. 
    1013    name = _("check case insensitive") 
    1114     
    12     # Longer description for this plugin. 
     15    # Both description and detail are reStructuredText format.  
     16    # Reference about reStructuredText: http://docutils.sourceforge.net/docs/user/rst/quickref.html 
     17 
     18    # Short description for this plugin. 
    1319    description = _("A pre-commit hook to detect case-insensitive filename clashes.") 
     20     
     21    # Long description for this plugin. 
     22    detail = "" 
    1423     
    1524    # Hooks-plugin type: T_START_COMMIT, ..., T_POST_UNLOCK 
    1625    type = T_PRE_COMMIT 
    17          
     26     
    1827    # Plugin config option/value in config ini file. 
    1928    key = "case_insensitive" 
     
    2231    def enabled(self): 
    2332        """ 
    24         Return True, if this plugin has been setup. 
     33        Return True, if this plugin has been installed. 
    2534        Simply call 'has_config()'. 
    2635        """ 
    2736        return self.has_config() 
    2837     
    29     def get_detail(self): 
     38    def install_info(self): 
    3039        """ 
    31         Show detail informantion if plugin is already installed. 
     40        Show configurations if plugin is already installed. 
     41         
     42        return reStructuredText. 
     43        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html 
    3244        """ 
    3345        return self.description 
     
    3850        If this plugin needs parameters, provides form fields here. 
    3951        Any html and javascript are welcome. 
    40          
    41         Default: just output description. 
    4252        """ 
    43         return super(CaseInsensitive, self).install_config_form() 
     53        return "" 
    4454         
    4555    def uninstall(self): 
  • trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py

    r45 r46  
    77class EolStyleCheck(PluginBase): 
    88 
     9    # Plugin id 
     10    id = __name__.rsplit('.',1)[-1] 
     11     
    912    # Brief name for this plugin. 
    1013    name = _("mime-type and eol-style check") 
    1114     
    12     # Longer description for this plugin. 
     15    # Both description and detail are reStructuredText format.  
     16    # Reference about reStructuredText: http://docutils.sourceforge.net/docs/user/rst/quickref.html 
     17 
     18    # Short description for this plugin. 
    1319    description = _("New file must provide svn:eol-style if not binary file.") 
     20     
     21    # Long description for this plugin. 
     22    detail = "" 
    1423     
    1524    # Hooks-plugin type: T_START_COMMIT, ..., T_POST_UNLOCK 
     
    2231    def enabled(self): 
    2332        """ 
    24         Return True, if this plugin has been setup. 
     33        Return True, if this plugin has been installed. 
    2534        Simply call 'has_config()'. 
    2635        """ 
    2736        return self.has_config() 
    2837     
    29     def get_detail(self): 
     38    def install_info(self): 
    3039        """ 
    31         Show detail informantion if plugin is already installed. 
     40        Show configurations if plugin is already installed. 
     41         
     42        return reStructuredText. 
     43        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html 
    3244        """ 
    3345        return self.description 
     
    3850        If this plugin needs parameters, provides form fields here. 
    3951        Any html and javascript are welcome. 
    40          
    41         Default: just output description. 
    4252        """ 
    43         return super(EolStyleCheck, self).install_config_form() 
     53        return "" 
    4454         
    4555    def uninstall(self): 
  • trunk/pysvnmanager/hooks/plugins/__init__.py

    r45 r46  
    55import time 
    66import logging 
     7 
     8from pysvnmanager.model.rest import reSTify 
    79 
    810# i18n works only as pysvnmanager (a pylons app) model. 
     
    6567    """ Base class for hook plugins 
    6668    """ 
     69    # Plugin id (must be override!) 
     70    id = __name__.rsplit('.',1)[-1] 
     71 
     72    # Both description and detail are reStructuredText format.  
     73    # Reference about reStructuredText: http://docutils.sourceforge.net/docs/user/rst/quickref.html 
     74     
    6775    # Brief name for this plugin. 
    6876    name = "" 
    6977     
    70     # Longer description for this plugin. 
     78    # Short description for this plugin. 
    7179    description = "" 
     80 
     81    # Long description for this plugin. 
     82    detail = "" 
    7283 
    7384    # Hooks-plugin type: T_START_COMMIT, ..., T_POST_UNLOCK 
     
    117128        return False 
    118129     
     130    def __cmp__(self, obj): 
     131        assert isinstance(obj, PluginBase) 
     132        if self.type == obj.type: 
     133            return cmp(self.id, obj.id) 
     134        else: 
     135            return cmp(self.type, obj.type) 
     136         
     137         
    119138    def reload(self, force=True): 
    120139        """ 
     
    153172        return result 
    154173 
    155     def has_config(self): 
     174    def has_config(self, key="", value=""): 
    156175        """ 
    157176        Test if self.key = self.value is in the default config ini file. 
    158177        """ 
    159         if not hasattr(self, "key") or not hasattr(self, "value"): 
    160             raise Exception, _("Plugin not fully implemented.") 
     178        if key == "": 
     179            if not hasattr(self, "key"): 
     180                raise Exception, _("Plugin not fully implemented.") 
     181            else: 
     182                key = self.key 
     183 
     184        if value == "": 
     185            if hasattr(self, "value"): 
     186                value = self.value 
    161187         
    162188        if hasattr(self, "section"): 
     
    165191            section = 'main' 
    166192         
    167         return self.get_config(self.key, section=section) == self.value 
    168          
    169     def set_config(self): 
     193        setting = self.get_config(key, section=section) 
     194        if value: 
     195            return setting == value 
     196        elif setting != "": 
     197            return True 
     198        else: 
     199            return False 
     200         
     201    def set_config(self, key="", value=""): 
    170202        """ 
    171203        add self.key = self.value to default config ini file. 
    172204        """ 
    173         if not hasattr(self, "key") or not hasattr(self, "value"): 
    174             raise Exception, _("Plugin not fully implemented.") 
     205        if key == "": 
     206            if not hasattr(self, "key"): 
     207                raise Exception, _("Plugin not fully implemented.") 
     208            else: 
     209                key = self.key 
     210 
     211        if value == "": 
     212            if not hasattr(self, "value"): 
     213                raise Exception, _("Plugin not fully implemented.") 
     214            else: 
     215                value = self.value 
    175216         
    176217        if hasattr(self, "section"): 
     
    181222        if not self.cp.has_section(section): 
    182223            self.cp.add_section(section) 
    183         self.cp.set(section, self.key, self.value) 
    184  
    185     def unset_config(self): 
     224        self.cp.set(section, key, value) 
     225 
     226    def unset_config(self, key=""): 
    186227        """ 
    187228        Remove self.key from default config ini file. 
    188229        """ 
    189         if not hasattr(self, "key") or not hasattr(self, "value"): 
    190             raise Exception, _("Plugin not fully implemented.") 
     230        if key == "": 
     231            if not hasattr(self, "key"): 
     232                raise Exception, _("Plugin not fully implemented.") 
     233            else: 
     234                key = self.key 
    191235         
    192236        if hasattr(self, "section"): 
     
    196240         
    197241        if self.cp.has_section(section): 
    198             self.cp.remove_option(section, self.key) 
     242            self.cp.remove_option(section, key) 
    199243            # test if section is blank after remove option. 
    200244            if not self.cp.options(section): 
    201245                self.cp.remove_section(section) 
    202246     
    203     def get_detail(self): 
    204         """ 
    205         Show detail informantion if plugin is already installed. 
    206         """ 
    207         if self.enabled(): 
    208             return self.description 
    209         else: 
    210             return "" 
    211      
    212     detail = property(get_detail) 
     247    def install_info(self): 
     248        """ 
     249        Show configurations if plugin is already installed. 
     250         
     251        return reStructuredText. 
     252        reST reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html 
     253        """ 
     254        return self.description 
     255     
     256    def show_install_info(self): 
     257        return reSTify(self.install_info()) 
    213258     
    214259    def get_type(self): 
     
    240285        Any html and javascript are welcome. 
    241286         
    242         Default: just output description. 
    243         """ 
    244         result = "<ul><li>" + _("Plugin name") + ": " + self.name + "\n" + \ 
    245                  "<li>" + _("Type") + ": " + self.get_type() + "\n" + \ 
    246                  "<li>" + _("Description") + ": " + self.description + "\n" 
    247         return result 
    248  
     287        If plugin does not need further configuration, simply return null str. 
     288        """ 
     289        return "" 
     290         
     291    def show_install_config_form(self): 
     292        """ 
     293        This method will be called to build setup configuration form. 
     294        If this plugin needs parameters, provides form fields here. 
     295        Any html and javascript are welcome. 
     296         
     297        return output reSTified html. 
     298        """ 
     299        header = """ 
     300**%(id)s** 
     301 
     302- %(t_name)s: %(name)s 
     303- %(t_name)s: %(type)s 
     304 
     305**%(t_desc)s** 
     306 
     307%(desc)s 
     308 
     309%(detail)s 
     310""" % { 
     311                't_name': _('Name'), 
     312                't_type': _('Type'), 
     313                't_desc': _('Description'), 
     314                'id':self.id.rsplit('.',1)[-1], 
     315                'name': self.name, 
     316                'type': self.get_type(), 
     317                'desc': self.description, 
     318                'detail': self.detail, 
     319                } 
     320 
     321        header = reSTify(header) 
     322        form = self.install_config_form() or "" 
     323        return header + form 
     324         
    249325    def enabled(self): 
    250326        """ 
  • trunk/pysvnmanager/i18n/en/LC_MESSAGES/pysvnmanager.po

    r45 r46  
    1010"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 
    1111"POT-Creation-Date: 2008-07-03 22:14+0800\n" 
    12 "PO-Revision-Date: 2008-08-27 00:06+0800\n" 
     12"PO-Revision-Date: 2008-08-27 21:52+0800\n" 
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
    1414"Language-Team: en <LL@li.org>\n" 
     
    145145 
    146146#: pysvnmanager/controllers/repos.py:81 
    147 #: pysvnmanager/hooks/plugins/__init__.py:244 
    148147msgid "Plugin name" 
    149148msgstr "" 
    150149 
    151150#: pysvnmanager/controllers/repos.py:82 
    152 #: pysvnmanager/hooks/plugins/__init__.py:245 
     151#: pysvnmanager/hooks/plugins/__init__.py:312 
    153152msgid "Type" 
    154153msgstr "" 
     
    158157msgstr "" 
    159158 
    160 #: pysvnmanager/controllers/repos.py:116 
     159#: pysvnmanager/controllers/repos.py:119 
    161160#, python-format 
    162161msgid "" 
     
    165164msgstr "" 
    166165 
    167 #: pysvnmanager/controllers/repos.py:119 
     166#: pysvnmanager/controllers/repos.py:122 
    168167#, python-format 
    169168msgid "Apply plugin '%(plugin)s' on '%(repos)s' success." 
    170169msgstr "" 
    171170 
    172 #: pysvnmanager/controllers/repos.py:140 
     171#: pysvnmanager/controllers/repos.py:143 
    173172#, python-format 
    174173msgid "" 
     
    177176msgstr "" 
    178177 
    179 #: pysvnmanager/controllers/repos.py:143 
     178#: pysvnmanager/controllers/repos.py:146 
    180179#, python-format 
    181180msgid "Delete plugin '%(plugin)s' on '%(repos)s' success." 
    182181msgstr "" 
    183182 
    184 #: pysvnmanager/controllers/repos.py:146 
     183#: pysvnmanager/controllers/repos.py:149 
    185184#, python-format 
    186185msgid "No plugin has been deleted for '%(repos)s'." 
    187186msgstr "" 
    188187 
    189 #: pysvnmanager/controllers/repos.py:155 
     188#: pysvnmanager/controllers/repos.py:158 
    190189#, python-format 
    191190msgid "" 
     
    194193msgstr "" 
    195194 
    196 #: pysvnmanager/controllers/repos.py:158 
     195#: pysvnmanager/controllers/repos.py:161 
    197196#, python-format 
    198197msgid "Create repository '%(repos)s' success." 
    199198msgstr "" 
    200199 
    201 #: pysvnmanager/controllers/repos.py:171 
     200#: pysvnmanager/controllers/repos.py:174 
    202201#, python-format 
    203202msgid "" 
     
    206205msgstr "" 
    207206 
    208 #: pysvnmanager/controllers/repos.py:174 
     207#: pysvnmanager/controllers/repos.py:177 
    209208#, python-format 
    210209msgid "Delete blank repository '%(repos)s' success." 
     
    246245msgstr "" 
    247246 
    248 #: pysvnmanager/hooks/plugins/CaseInsensitive.py:10 
     247#: pysvnmanager/hooks/plugins/BugtrackMantis.py:13 
     248msgid "Mantis bugtracking integration" 
     249msgstr "" 
     250 
     251#: pysvnmanager/hooks/plugins/BugtrackMantis.py:19 
     252msgid "" 
     253"Integration Subversion with Mantis bugtracking. If commit-log has proper " 
     254"format (contains bugid), it will change bug status and append commint-log" 
     255" and code differ as comment of bug status change." 
     256msgstr "" 
     257 
     258#: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 
    249259msgid "check case insensitive" 
    250260msgstr "" 
    251261 
    252 #: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 
     262#: pysvnmanager/hooks/plugins/CaseInsensitive.py:19 
    253263msgid "A pre-commit hook to detect case-insensitive filename clashes." 
    254264msgstr "" 
    255265 
    256 #: pysvnmanager/hooks/plugins/EolStyleCheck.py:10 
     266#: pysvnmanager/hooks/plugins/CommitLogCheck.py:13 
     267msgid "Check commit log message" 
     268msgstr "" 
     269 
     270#: pysvnmanager/hooks/plugins/CommitLogCheck.py:19 
     271msgid "User must provide commit-log message when checkin." 
     272msgstr "" 
     273 
     274#: pysvnmanager/hooks/plugins/EmailNotify.py:13 
     275msgid "Send email notify for commit event" 
     276msgstr "" 
     277 
     278#: pysvnmanager/hooks/plugins/EmailNotify.py:19 
     279msgid "" 
     280"Send a notification email describing either a commit or a revprop-change " 
     281"action on a Subversion repository." 
     282msgstr "" 
     283 
     284#: pysvnmanager/hooks/plugins/EmailNotify.py:23 
     285msgid "" 
     286"\n" 
     287"You must provide proper options to commit-email.pl using the\n" 
     288"configuration form for this plugin.\n" 
     289"\n" 
     290"You can simply just provide the email_addr as the options.\n" 
     291"\n" 
     292"  [options] email_addr [email_addr ...]\n" 
     293"\n" 
     294"But to be more versitile, you can setup a path-based email \n" 
     295"notifier.\n" 
     296"\n" 
     297"  [-m regex1] [options] [email_addr ...]\n" 
     298"  [-m regex2] [options] [email_addr ...] \n" 
     299"  ...\n" 
     300"\n" 
     301"Options:\n" 
     302"\n" 
     303"-m regex              Regular expression to match committed path\n" 
     304"--from email_address  Email address for 'From:' (overrides -h)\n" 
     305"-r email_address      Email address for 'Reply-To:\n" 
     306"-s subject_prefix     Subject line prefix\n" 
     307"--diff n              Do not include diff in message (default: y)\n" 
     308msgstr "" 
     309 
     310#: pysvnmanager/hooks/plugins/EmailNotify.py:75 
     311msgid "- Email notify enabled." 
     312msgstr "" 
     313 
     314#: pysvnmanager/hooks/plugins/EmailNotify.py:77 
     315msgid "- Email notify disabled." 
     316msgstr "" 
     317 
     318#: pysvnmanager/hooks/plugins/EmailNotify.py:79 
     319msgid "- Parameters: ``" 
     320msgstr "" 
     321 
     322#: pysvnmanager/hooks/plugins/EmailNotify.py:97 
     323msgid "Fill this form" 
     324msgstr "" 
     325 
     326#: pysvnmanager/hooks/plugins/EmailNotify.py:99 
     327msgid "Enable email notify." 
     328msgstr "" 
     329 
     330#: pysvnmanager/hooks/plugins/EmailNotify.py:101 
     331msgid "Enable" 
     332msgstr "" 
     333 
     334#: pysvnmanager/hooks/plugins/EmailNotify.py:103 
     335msgid "Disable" 
     336msgstr "" 
     337 
     338#: pysvnmanager/hooks/plugins/EmailNotify.py:104 
     339msgid "Input email notify configurations: " 
     340msgstr "" 
     341 
     342#: pysvnmanager/hooks/plugins/EmailNotify.py:131 
     343msgid "Wrong configuration." 
     344msgstr "" 
     345 
     346#: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 
    257347msgid "mime-type and eol-style check" 
    258348msgstr "" 
    259349 
    260 #: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 
     350#: pysvnmanager/hooks/plugins/EolStyleCheck.py:19 
    261351msgid "New file must provide svn:eol-style if not binary file." 
    262352msgstr "" 
    263353 
    264 #: pysvnmanager/hooks/plugins/__init__.py:84 
     354#: pysvnmanager/hooks/plugins/MergeinfoClient.py:13 
     355msgid "Subversion client mergeinfo capability check" 
     356msgstr "" 
     357 
     358#: pysvnmanager/hooks/plugins/MergeinfoClient.py:19 
     359msgid "Do not allow subversion client (<1.5) to checkin." 
     360msgstr "" 
     361 
     362#: pysvnmanager/hooks/plugins/__init__.py:95 
    265363#, python-format 
    266364msgid "repos '%s' not exist!" 
    267365msgstr "" 
    268366 
    269 #: pysvnmanager/hooks/plugins/__init__.py:133 
     367#: pysvnmanager/hooks/plugins/__init__.py:152 
    270368#, python-format 
    271369msgid "Conflict: plugin '%s' is modified by others." 
    272370msgstr "" 
    273371 
    274 #: pysvnmanager/hooks/plugins/__init__.py:160 
    275 #: pysvnmanager/hooks/plugins/__init__.py:174 
    276 #: pysvnmanager/hooks/plugins/__init__.py:190 
    277 #: pysvnmanager/hooks/plugins/__init__.py:254 
    278 #: pysvnmanager/hooks/plugins/__init__.py:261 
    279 #: pysvnmanager/hooks/plugins/__init__.py:270 
     372#: pysvnmanager/hooks/plugins/__init__.py:180 
     373#: pysvnmanager/hooks/plugins/__init__.py:207 
     374#: pysvnmanager/hooks/plugins/__init__.py:213 
     375#: pysvnmanager/hooks/plugins/__init__.py:232 
     376#: pysvnmanager/hooks/plugins/__init__.py:330 
     377#: pysvnmanager/hooks/plugins/__init__.py:337 
     378#: pysvnmanager/hooks/plugins/__init__.py:346 
    280379msgid "Plugin not fully implemented." 
    281380msgstr "" 
    282381 
    283 #: pysvnmanager/hooks/plugins/__init__.py:246 
     382#: pysvnmanager/hooks/plugins/__init__.py:311 
     383msgid "Name" 
     384msgstr "" 
     385 
     386#: pysvnmanager/hooks/plugins/__init__.py:313 
    284387msgid "Description" 
    285388msgstr "" 
     
    422525#: pysvnmanager/templates/base.mako:36 
    423526#: pysvnmanager/templates/repos/hooks.mako:5 
    424 #: pysvnmanager/templates/repos/hooks.mako:189 
     527#: pysvnmanager/templates/repos/hooks.mako:182 
    425528msgid "Repos management" 
    426529msgstr "" 
     
    503606 
    504607#: pysvnmanager/templates/authz/index.mako:597 
    505 #: pysvnmanager/templates/repos/hooks.mako:195 
     608#: pysvnmanager/templates/repos/hooks.mako:188 
    506609msgid "Repository:" 
    507610msgstr "" 
     
    662765msgstr "" 
    663766 
    664 #: pysvnmanager/templates/repos/hooks.mako:198 
     767#: pysvnmanager/templates/repos/hooks.mako:191 
    665768msgid "Add repository" 
    666769msgstr "" 
    667770 
    668 #: pysvnmanager/templates/repos/hooks.mako:199 
     771#: pysvnmanager/templates/repos/hooks.mako:192 
    669772#: pysvnmanager/templates/repos/remove.mako:5 
    670773#: pysvnmanager/templates/repos/remove.mako:49 
     
    673776msgstr "" 
    674777 
    675 #: pysvnmanager/templates/repos/hooks.mako:204 
     778#: pysvnmanager/templates/repos/hooks.mako:197 
    676779msgid "Uninstalled hooks:" 
    677780msgstr "" 
    678781 
    679 #: pysvnmanager/templates/repos/hooks.mako:226 
    680 msgid "Enable this hook" 
     782#: pysvnmanager/templates/repos/hooks.mako:223 
     783msgid "Install this plugin" 
    681784msgstr "" 
    682785 
     
    762865msgstr "" 
    763866 
     867#~ msgid "" 
     868#~ "\n" 
     869#~ "**%(id)s**\n" 
     870#~ "\n" 
     871#~ "- %(t_name)s: %(name)s\n" 
     872#~ "- %(t_name)s: %(type)s\n" 
     873#~ "\n" 
     874#~ "**%(t_desc)s**\n" 
     875#~ "\n" 
     876#~ "%(desc)s\n" 
     877#~ "\n" 
     878#~ "%(detail)s\n" 
     879#~ msgstr "" 
     880 
  • trunk/pysvnmanager/i18n/pysvnmanager.pot

    r45 r46  
    99"Project-Id-Version: pySvnManager 0.2.0\n" 
    1010"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 
    11 "POT-Creation-Date: 2008-08-27 00:06+0800\n" 
     11"POT-Creation-Date: 2008-08-27 21:52+0800\n" 
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
     
    137137msgstr "" 
    138138 
    139 #: pysvnmanager/controllers/repos.py:81 pysvnmanager/hooks/plugins/__init__.py:244 
     139#: pysvnmanager/controllers/repos.py:81 
    140140msgid "Plugin name" 
    141141msgstr "" 
    142142 
    143 #: pysvnmanager/controllers/repos.py:82 pysvnmanager/hooks/plugins/__init__.py:245 
     143#: pysvnmanager/controllers/repos.py:82 pysvnmanager/hooks/plugins/__init__.py:312 
    144144msgid "Type" 
    145145msgstr "" 
     
    149149msgstr "" 
    150150 
    151 #: pysvnmanager/controllers/repos.py:116 
     151#: pysvnmanager/controllers/repos.py:119 
    152152#, python-format 
    153153msgid "" 
     
    156156msgstr "" 
    157157 
    158 #: pysvnmanager/controllers/repos.py:119 
     158#: pysvnmanager/controllers/repos.py:122 
    159159#, python-format 
    160160msgid "Apply plugin '%(plugin)s' on '%(repos)s' success." 
    161161msgstr "" 
    162162 
    163 #: pysvnmanager/controllers/repos.py:140 
     163#: pysvnmanager/controllers/repos.py:143 
    164164#, python-format 
    165165msgid "" 
     
    168168msgstr "" 
    169169 
    170 #: pysvnmanager/controllers/repos.py:143 
     170#: pysvnmanager/controllers/repos.py:146 
    171171#, python-format 
    172172msgid "Delete plugin '%(plugin)s' on '%(repos)s' success." 
    173173msgstr "" 
    174174 
    175 #: pysvnmanager/controllers/repos.py:146 
     175#: pysvnmanager/controllers/repos.py:149 
    176176#, python-format 
    177177msgid "No plugin has been deleted for '%(repos)s'." 
    178178msgstr "" 
    179179 
    180 #: pysvnmanager/controllers/repos.py:155 
     180#: pysvnmanager/controllers/repos.py:158 
    181181#, python-format 
    182182msgid "" 
     
    185185msgstr "" 
    186186 
    187 #: pysvnmanager/controllers/repos.py:158 
     187#: pysvnmanager/controllers/repos.py:161 
    188188#, python-format 
    189189msgid "Create repository '%(repos)s' success." 
    190190msgstr "" 
    191191 
    192 #: pysvnmanager/controllers/repos.py:171 
     192#: pysvnmanager/controllers/repos.py:174 
    193193#, python-format 
    194194msgid "" 
     
    197197msgstr "" 
    198198 
    199 #: pysvnmanager/controllers/repos.py:174 
     199#: pysvnmanager/controllers/repos.py:177 
    200200#, python-format 
    201201msgid "Delete blank repository '%(repos)s' success." 
     
    237237msgstr "" 
    238238 
    239 #: pysvnmanager/hooks/plugins/CaseInsensitive.py:10 
     239#: pysvnmanager/hooks/plugins/BugtrackMantis.py:13 
     240msgid "Mantis bugtracking integration" 
     241msgstr "" 
     242 
     243#: pysvnmanager/hooks/plugins/BugtrackMantis.py:19 
     244msgid "" 
     245"Integration Subversion with Mantis bugtracking. If commit-log has proper " 
     246"format (contains bugid), it will change bug status and append commint-log and" 
     247" code differ as comment of bug status change." 
     248msgstr "" 
     249 
     250#: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 
    240251msgid "check case insensitive" 
    241252msgstr "" 
    242253 
    243 #: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 
     254#: pysvnmanager/hooks/plugins/CaseInsensitive.py:19 
    244255msgid "A pre-commit hook to detect case-insensitive filename clashes." 
    245256msgstr "" 
    246257 
    247 #: pysvnmanager/hooks/plugins/EolStyleCheck.py:10 
     258#: pysvnmanager/hooks/plugins/CommitLogCheck.py:13 
     259msgid "Check commit log message" 
     260msgstr "" 
     261 
     262#: pysvnmanager/hooks/plugins/CommitLogCheck.py:19 
     263msgid "User must provide commit-log message when checkin." 
     264msgstr "" 
     265 
     266#: pysvnmanager/hooks/plugins/EmailNotify.py:13 
     267msgid "Send email notify for commit event" 
     268msgstr "" 
     269 
     270#: pysvnmanager/hooks/plugins/EmailNotify.py:19 
     271msgid "" 
     272"Send a notification email describing either a commit or a revprop-change " 
     273"action on a Subversion repository." 
     274msgstr "" 
     275 
     276#: pysvnmanager/hooks/plugins/EmailNotify.py:23 
     277msgid "" 
     278"\n" 
     279"You must provide proper options to commit-email.pl using the\n" 
     280"configuration form for this plugin.\n" 
     281"\n" 
     282"You can simply just provide the email_addr as the options.\n" 
     283"\n" 
     284"  [options] email_addr [email_addr ...]\n" 
     285"\n" 
     286"But to be more versitile, you can setup a path-based email \n" 
     287"notifier.\n" 
     288"\n" 
     289"  [-m regex1] [options] [email_addr ...]\n" 
     290"  [-m regex2] [options] [email_addr ...] \n" 
     291"  ...\n" 
     292"\n" 
     293"Options:\n" 
     294"\n" 
     295"-m regex              Regular expression to match committed path\n" 
     296"--from email_address  Email address for 'From:' (overrides -h)\n" 
     297"-r email_address      Email address for 'Reply-To:\n" 
     298"-s subject_prefix     Subject line prefix\n" 
     299"--diff n              Do not include diff in message (default: y)\n" 
     300msgstr "" 
     301 
     302#: pysvnmanager/hooks/plugins/EmailNotify.py:75 
     303msgid "- Email notify enabled." 
     304msgstr "" 
     305 
     306#: pysvnmanager/hooks/plugins/EmailNotify.py:77 
     307msgid "- Email notify disabled." 
     308msgstr "" 
     309 
     310#: pysvnmanager/hooks/plugins/EmailNotify.py:79 
     311msgid "- Parameters: ``" 
     312msgstr "" 
     313 
     314#: pysvnmanager/hooks/plugins/EmailNotify.py:97 
     315msgid "Fill this form" 
     316msgstr "" 
     317 
     318#: pysvnmanager/hooks/plugins/EmailNotify.py:99 
     319msgid "Enable email notify." 
     320msgstr "" 
     321 
     322#: pysvnmanager/hooks/plugins/EmailNotify.py:101 
     323msgid "Enable" 
     324msgstr "" 
     325 
     326#: pysvnmanager/hooks/plugins/EmailNotify.py:103 
     327msgid "Disable" 
     328msgstr "" 
     329 
     330#: pysvnmanager/hooks/plugins/EmailNotify.py:104 
     331msgid "Input email notify configurations: " 
     332msgstr "" 
     333 
     334#: pysvnmanager/hooks/plugins/EmailNotify.py:131 
     335msgid "Wrong configuration." 
     336msgstr "" 
     337 
     338#: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 
    248339msgid "mime-type and eol-style check" 
    249340msgstr "" 
    250341 
    251 #: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 
     342#: pysvnmanager/hooks/plugins/EolStyleCheck.py:19 
    252343msgid "New file must provide svn:eol-style if not binary file." 
    253344msgstr "" 
    254345 
    255 #: pysvnmanager/hooks/plugins/__init__.py:84 
     346#: pysvnmanager/hooks/plugins/MergeinfoClient.py:13 
     347msgid "Subversion client mergeinfo capability check" 
     348msgstr "" 
     349 
     350#: pysvnmanager/hooks/plugins/MergeinfoClient.py:19 
     351msgid "Do not allow subversion client (<1.5) to checkin." 
     352msgstr "" 
     353 
     354#: pysvnmanager/hooks/plugins/__init__.py:95 
    256355#, python-format 
    257356msgid "repos '%s' not exist!" 
    258357msgstr "" 
    259358 
    260 #: pysvnmanager/hooks/plugins/__init__.py:133 
     359#: pysvnmanager/hooks/plugins/__init__.py:152 
    261360#, python-format 
    262361msgid "Conflict: plugin '%s' is modified by others." 
    263362msgstr "" 
    264363 
    265 #: pysvnmanager/hooks/plugins/__init__.py:160 
    266 #: pysvnmanager/hooks/plugins/__init__.py:174 
    267 #: pysvnmanager/hooks/plugins/__init__.py:190 
    268 #: pysvnmanager/hooks/plugins/__init__.py:254 
    269 #: pysvnmanager/hooks/plugins/__init__.py:261 
    270 #: pysvnmanager/hooks/plugins/__init__.py:270 
     364#: pysvnmanager/hooks/plugins/__init__.py:180 
     365#: pysvnmanager/hooks/plugins/__init__.py:207 
     366#: pysvnmanager/hooks/plugins/__init__.py:213 
     367#: pysvnmanager/hooks/plugins/__init__.py:232 
     368#: pysvnmanager/hooks/plugins/__init__.py:330 
     369#: pysvnmanager/hooks/plugins/__init__.py:337 
     370#: pysvnmanager/hooks/plugins/__init__.py:346 
    271371msgid "Plugin not fully implemented." 
    272372msgstr "" 
    273373 
    274 #: pysvnmanager/hooks/plugins/__init__.py:246 
     374#: pysvnmanager/hooks/plugins/__init__.py:311 
     375msgid "Name" 
     376msgstr "" 
     377 
     378#: pysvnmanager/hooks/plugins/__init__.py:313 
    275379msgid "Description" 
    276380msgstr "" 
     
    411515 
    412516#: pysvnmanager/templates/base.mako:36 pysvnmanager/templates/repos/hooks.mako:5 
    413 #: pysvnmanager/templates/repos/hooks.mako:189 
     517#: pysvnmanager/templates/repos/hooks.mako:182 
    414518msgid "Repos management" 
    415519msgstr "" 
     
    492596 
    493597#: pysvnmanager/templates/authz/index.mako:597 
    494 #: pysvnmanager/templates/repos/hooks.mako:195 
     598#: pysvnmanager/templates/repos/hooks.mako:188 
    495599msgid "Repository:" 
    496600msgstr "" 
     
    651755msgstr "" 
    652756 
    653 #: pysvnmanager/templates/repos/hooks.mako:198 
     757#: pysvnmanager/templates/repos/hooks.mako:191 
    654758msgid "Add repository" 
    655759msgstr "" 
    656760 
    657 #: pysvnmanager/templates/repos/hooks.mako:199 
     761#: pysvnmanager/templates/repos/hooks.mako:192 
    658762#: pysvnmanager/templates/repos/remove.mako:5 
    659763#: pysvnmanager/templates/repos/remove.mako:49 
     
    662766msgstr "" 
    663767 
    664 #: pysvnmanager/templates/repos/hooks.mako:204 
     768#: pysvnmanager/templates/repos/hooks.mako:197 
    665769msgid "Uninstalled hooks:" 
    666770msgstr "" 
    667771 
    668 #: pysvnmanager/templates/repos/hooks.mako:226 
    669 msgid "Enable this hook" 
     772#: pysvnmanager/templates/repos/hooks.mako:223 
     773msgid "Install this plugin" 
    670774msgstr "" 
    671775 
  • trunk/pysvnmanager/i18n/zh/LC_MESSAGES/pysvnmanager.po

    r45 r46  
    99msgid "" 
    1010msgstr "" 
    11 "Project-Id-Version: pysvnmanager\n" 
     11"Project-Id-Version:  pysvnmanager\n" 
    1212"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" 
    1313"POT-Creation-Date: 2008-07-03 22:14+0800\n" 
    14 "PO-Revision-Date: 2008-08-27 00:07+0800\n" 
     14"PO-Revision-Date: 2008-08-27 21:52+0800\n" 
    1515"Last-Translator: Jiang Xin <worldhello.net@gmail.com>\n" 
    16 "Language-Team:  <zh@li.org>\n" 
     16"Language-Team: <zh@li.org>\n" 
    1717"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n" 
    1818"MIME-Version: 1.0\n" 
    19 "Content-Type: text/plain; charset=UTF-8\n" 
     19"Content-Type: text/plain; charset=utf-8\n" 
    2020"Content-Transfer-Encoding: 8bit\n" 
    2121"Generated-By: Babel 0.9.2\n" 
    22 "X-Generator: KBabel 1.11.4\n" 
    2322 
    2423#: pysvnmanager/controllers/authz.py:43 
     
    148147 
    149148#: pysvnmanager/controllers/repos.py:81 
    150 #: pysvnmanager/hooks/plugins/__init__.py:244 
    151149msgid "Plugin name" 
    152150msgstr "插件名称" 
    153151 
    154152#: pysvnmanager/controllers/repos.py:82 
    155 #: pysvnmanager/hooks/plugins/__init__.py:245 
     153#: pysvnmanager/hooks/plugins/__init__.py:312 
    156154msgid "Type" 
    157155msgstr "类型" 
     
    161159msgstr "删除选择的插件" 
    162160 
    163 #: pysvnmanager/controllers/repos.py:116 
     161#: pysvnmanager/controllers/repos.py:119 
    164162#, python-format 
    165163msgid "" 
     
    170168"%(msg)s" 
    171169 
    172 #: pysvnmanager/controllers/repos.py:119 
     170#: pysvnmanager/controllers/repos.py:122 
    173171#, python-format 
    174172msgid "Apply plugin '%(plugin)s' on '%(repos)s' success." 
    175173msgstr "成功启用版本库'%(repos)s'的插件'%(plugin)s'。 " 
    176174 
    177 #: pysvnmanager/controllers/repos.py:140 
     175#: pysvnmanager/controllers/repos.py:143 
    178176#, python-format 
    179177msgid "" 
     
    184182"%(msg)s" 
    185183 
    186 #: pysvnmanager/controllers/repos.py:143 
     184#: pysvnmanager/controllers/repos.py:146 
    187185#, python-format 
    188186msgid "Delete plugin '%(plugin)s' on '%(repos)s' success." 
    189187msgstr "成功删除版本库'%(repos)s'的插件'%(plugin)s'。" 
    190188 
    191 #: pysvnmanager/controllers/repos.py:146 
     189#: pysvnmanager/controllers/repos.py:149 
    192190#, python-format 
    193191msgid "No plugin has been deleted for '%(repos)s'." 
    194192msgstr "未删除版本库'%(repos)s'的插件。" 
    195193 
    196 #: pysvnmanager/controllers/repos.py:155 
     194#: pysvnmanager/controllers/repos.py:158 
    197195#, python-format 
    198196msgid "" 
     
    203201"%(msg)s" 
    204202 
    205 #: pysvnmanager/controllers/repos.py:158 
     203#: pysvnmanager/controllers/repos.py:161 
    206204#, python-format 
    207205msgid "Create repository '%(repos)s' success." 
    208206msgstr "成功创建版本库'%(repos)s'。" 
    209207 
    210 #: pysvnmanager/controllers/repos.py:171 
     208#: pysvnmanager/controllers/repos.py:174 
    211209#, python-format 
    212210msgid "" 
     
    217215"%(msg)s" 
    218216 
    219 #: pysvnmanager/controllers/repos.py:174 
     217#: pysvnmanager/controllers/repos.py:177 
    220218#, python-format 
    221219msgid "Delete blank repository '%(repos)s' success." 
     
    257255msgstr "用户 %s 登出" 
    258256 
    259 #: pysvnmanager/hooks/plugins/CaseInsensitive.py:10 
     257#: pysvnmanager/hooks/plugins/BugtrackMantis.py:13 
     258msgid "Mantis bugtracking integration" 
     259msgstr "整合 Mantis 缺陷跟踪系统" 
     260 
     261#: pysvnmanager/hooks/plugins/BugtrackMantis.py:19 
     262msgid "" 
     263"Integration Subversion with Mantis bugtracking. If commit-log has proper " 
     264"format (contains bugid), it will change bug status and append commint-log" 
     265" and code differ as comment of bug status change." 
     266msgstr "" 
     267"与 Mantis 缺陷跟踪系统整合。当提交日志符合特定的规范(包含 bugid),将会触发 Mantis 缺陷跟踪系统,将 bug " 
     268"的状态修改为已修改,并将commit-log 以及代码变更添加到说明中。" 
     269 
     270#: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 
    260271msgid "check case insensitive" 
    261272msgstr "大小写不敏感" 
    262273 
    263 #: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 
     274#: pysvnmanager/hooks/plugins/CaseInsensitive.py:19 
    264275msgid "A pre-commit hook to detect case-insensitive filename clashes." 
    265276msgstr "在 pre-commit 钩子中执行,检查文件名大小写引起的文件名冲突。" 
    266277 
    267 #: pysvnmanager/hooks/plugins/EolStyleCheck.py:10 
     278#: pysvnmanager/hooks/plugins/CommitLogCheck.py:13 
     279msgid "Check commit log message" 
     280msgstr "检查提交说明" 
     281 
     282#: pysvnmanager/hooks/plugins/CommitLogCheck.py:19 
     283msgid "User must provide commit-log message when checkin." 
     284msgstr "用户在代码提交时,必须提供提交说明。" 
     285 
     286#: pysvnmanager/hooks/plugins/EmailNotify.py:13 
     287msgid "Send email notify for commit event" 
     288msgstr "针对代码变更发出邮件通知" 
     289 
     290#: pysvnmanager/hooks/plugins/EmailNotify.py:19 
     291msgid "" 
     292"Send a notification email describing either a commit or a revprop-change " 
     293"action on a Subversion repository." 
     294msgstr "当对 Subversion 代码库中的代码修改或者修改状态,发出邮件通知。" 
     295 
     296#: pysvnmanager/hooks/plugins/EmailNotify.py:23 
     297msgid "" 
     298"\n" 
     299"You must provide proper options to commit-email.pl using the\n" 
     300"configuration form for this plugin.\n" 
     301"\n" 
     302"You can simply just provide the email_addr as the options.\n" 
     303"\n" 
     304"  [options] email_addr [email_addr ...]\n" 
     305"\n" 
     306"But to be more versitile, you can setup a path-based email \n" 
     307"notifier.\n" 
     308"\n" 
     309"  [-m regex1] [options] [email_addr ...]\n" 
     310"  [-m regex2] [options] [email_addr ...] \n" 
     311"  ...\n" 
     312"\n" 
     313"Options:\n" 
     314"\n" 
     315"-m regex              Regular expression to match committed path\n" 
     316"--from email_address  Email address for 'From:' (overrides -h)\n" 
     317"-r email_address      Email address for 'Reply-To:\n" 
     318"-s subject_prefix     Subject line prefix\n" 
     319"--diff n              Do not include diff in message (default: y)\n" 
     320msgstr "" 
     321"\n" 
     322"您需要为代码变更的邮件通知设置参数。\n" 
     323"\n" 
     324"可以简单的提供邮件地址即可:\n" 
     325"\n" 
     326"  [options] email_addr [email_addr ...]\n" 
     327"\n" 
     328"或者基于正则表达式,提供一个基于路径的代码变更的邮件通知。\n" 
     329"\n" 
     330"  [-m regex1] [options] [email_addr ...]\n" 
     331"  [-m regex2] [options] [email_addr ...] \n" 
     332"  ...\n" 
     333"\n" 
     334"参数:\n" 
     335"\n" 
     336"-m regex              和提交路径相匹配的正则表达式\n" 
     337"--from email_address  发信人地址\n" 
     338"-r email_address      回复邮件地址\n" 
     339"-s subject_prefix     标题的前缀,如 [Prefix]\n" 
     340"--diff n              不包含代码差异(缺省包含)\n" 
     341 
     342#: pysvnmanager/hooks/plugins/EmailNotify.py:75 
     343msgid "- Email notify enabled." 
     344msgstr "- 邮件通知启用。" 
     345 
     346#: pysvnmanager/hooks/plugins/EmailNotify.py:77 
     347msgid "- Email notify disabled." 
     348msgstr "- 邮件通知关闭。" 
     349 
     350#: pysvnmanager/hooks/plugins/EmailNotify.py:79 
     351msgid "- Parameters: ``" 
     352msgstr "- 参数: ``" 
     353 
     354#: pysvnmanager/hooks/plugins/EmailNotify.py:97 
     355msgid "Fill this form" 
     356msgstr "填写表单" 
     357 
     358#: pysvnmanager/hooks/plugins/EmailNotify.py:99 
     359msgid "Enable email notify." 
     360msgstr "启用邮件通知。" 
     361 
     362#: pysvnmanager/hooks/plugins/EmailNotify.py:101 
     363msgid "Enable" 
     364msgstr "启用" 
     365 
     366#: pysvnmanager/hooks/plugins/EmailNotify.py:103 
     367msgid "Disable" 
     368msgstr "关闭" 
     369 
     370#: pysvnmanager/hooks/plugins/EmailNotify.py:104 
     371msgid "Input email notify configurations: " 
     372msgstr "输入邮件通知配置参数: " 
     373 
     374#: pysvnmanager/hooks/plugins/EmailNotify.py:131 
     375msgid "Wrong configuration." 
     376msgstr "错误的配置" 
     377 
     378#: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 
    268379msgid "mime-type and eol-style check" 
    269380msgstr "文件类型和换行符设置检查" 
    270381 
    271 #: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 
     382#: pysvnmanager/hooks/plugins/EolStyleCheck.py:19 
    272383msgid "New file must provide svn:eol-style if not binary file." 
    273384msgstr "新增的文本文件,必须设置换行符。" 
    274385 
    275 #: pysvnmanager/hooks/plugins/__init__.py:84 
     386#: pysvnmanager/hooks/plugins/MergeinfoClient.py:13 
     387msgid "Subversion client mergeinfo capability check" 
     388msgstr "Subversion 客户端版本检查(mergeinfo 功能)" 
     389 
     390#: pysvnmanager/hooks/plugins/MergeinfoClient.py:19 
     391msgid "Do not allow subversion client (<1.5) to checkin." 
     392msgstr "不允许小于 1.5 的 subversion 客户端进行提交。" 
     393 
     394#: pysvnmanager/hooks/plugins/__init__.py:95 
    276395#, python-format 
    277396msgid "repos '%s' not exist!" 
    278397msgstr "版本库 %s 不存在!" 
    279398 
    280 #: pysvnmanager/hooks/plugins/__init__.py:133 
     399#: pysvnmanager/hooks/plugins/__init__.py:152 
    281400#, python-format 
    282401msgid "Conflict: plugin '%s' is modified by others." 
    283402msgstr "冲突:插件'%s'被其他人修改了。" 
    284403 
    285 #: pysvnmanager/hooks/plugins/__init__.py:160 
    286 #: pysvnmanager/hooks/plugins/__init__.py:174 
    287 #: pysvnmanager/hooks/plugins/__init__.py:190 
    288 #: pysvnmanager/hooks/plugins/__init__.py:254 
    289 #: pysvnmanager/hooks/plugins/__init__.py:261 
    290 #: pysvnmanager/hooks/plugins/__init__.py:270 
     404#: pysvnmanager/hooks/plugins/__init__.py:180 
     405#: pysvnmanager/hooks/plugins/__init__.py:207 
     406#: pysvnmanager/hooks/plugins/__init__.py:213 
     407#: pysvnmanager/hooks/plugins/__init__.py:232 
     408#: pysvnmanager/hooks/plugins/__init__.py:330 
     409#: pysvnmanager/hooks/plugins/__init__.py:337 
     410#: pysvnmanager/hooks/plugins/__init__.py:346 
    291411msgid "Plugin not fully implemented." 
    292412msgstr "插件未完全实现。" 
    293413 
    294 #: pysvnmanager/hooks/plugins/__init__.py:246 
     414#: pysvnmanager/hooks/plugins/__init__.py:311 
     415msgid "Name" 
     416msgstr "名称" 
     417 
     418#: pysvnmanager/hooks/plugins/__init__.py:313 
    295419msgid "Description" 
    296 msgstr "描述" 
     420msgstr "说明" 
    297421 
    298422#: pysvnmanager/model/repos.py:39 
     
    453577#: pysvnmanager/templates/base.mako:36 
    454578#: pysvnmanager/templates/repos/hooks.mako:5 
    455 #: pysvnmanager/templates/repos/hooks.mako:189 
     579#: pysvnmanager/templates/repos/hooks.mako:182 
    456580msgid "Repos management" 
    457581msgstr "版本库管理" 
     
    534658 
    535659#: pysvnmanager/templates/authz/index.mako:597 
    536 #: pysvnmanager/templates/repos/hooks.mako:195 
     660#: pysvnmanager/templates/repos/hooks.mako:188 
    537661msgid "Repository:" 
    538662msgstr "版本库:" 
     
    693817msgstr "版本库名称:" 
    694818 
    695 #: pysvnmanager/templates/repos/hooks.mako:198 
     819#: pysvnmanager/templates/repos/hooks.mako:191 
    696820msgid "Add repository" 
    697821msgstr "添加版本库" 
    698822 
    699 #: pysvnmanager/templates/repos/hooks.mako:199 
     823#: pysvnmanager/templates/repos/hooks.mako:192 
    700824#: pysvnmanager/templates/repos/remove.mako:5 
    701825#: pysvnmanager/templates/repos/remove.mako:49 
     
    704828msgstr "删除版本库" 
    705829 
    706 #: pysvnmanager/templates/repos/hooks.mako:204 
     830#: pysvnmanager/templates/repos/hooks.mako:197 
    707831msgid "Uninstalled hooks:" 
    708832msgstr "尚未安装的插件:" 
    709833 
    710 #: pysvnmanager/templates/repos/hooks.mako:226 
    711 msgid "Enable this hook" 
    712 msgstr "启用此插件" 
     834#: pysvnmanager/templates/repos/hooks.mako:223 
     835msgid "Install this plugin" 
     836msgstr "安装此插件" 
    713837 
    714838#: pysvnmanager/templates/role/index.mako:5 
     
    793917msgstr "用户名:" 
    794918 
     919#~ msgid "" 
     920#~ "\n" 
     921#~ "**%(id)s**\n" 
     922#~ "\n" 
     923#~ "- %(t_name)s: %(name)s\n" 
     924#~ "- %(t_name)s: %(type)s\n" 
     925#~ "\n" 
     926#~ "**%(t_desc)s**\n" 
     927#~ "\n" 
     928#~ "%(desc)s\n" 
     929#~ "\n" 
     930#~ "%(detail)s\n" 
     931#~ msgstr "" 
     932 
  • trunk/pysvnmanager/templates/repos/hooks.mako

    r45 r46  
    1616        document.getElementById('repos_list_box').style.position = 'relative'; 
    1717         
    18         document.getElementById('new_hook_list_box').style.visibility = 'hidden'; 
    19         document.getElementById('new_hook_list_box').style.position = 'absolute'; 
    20  
    21         document.getElementById('new_hook_setting_box').style.visibility = 'hidden'; 
    22         document.getElementById('new_hook_setting_box').style.position = 'absolute'; 
     18        document.getElementById('uninstall_hook_box').style.visibility = 'hidden'; 
     19        document.getElementById('uninstall_hook_box').style.position = 'absolute'; 
     20 
     21        document.getElementById('hook_setting_box').style.visibility = 'hidden'; 
     22        document.getElementById('hook_setting_box').style.position = 'absolute'; 
    2323                         
    24         document.getElementById('remove_hook_box').style.visibility = 'visible'; 
    25         document.getElementById('remove_hook_box').style.position = 'relative'; 
     24        document.getElementById('installed_hook_box').style.visibility = 'visible'; 
     25        document.getElementById('installed_hook_box').style.position = 'relative'; 
    2626} 
    2727 
     
    6969        if (name=='...'||name=='') 
    7070        { 
    71                 document.getElementById('remove_hook_form_content').innerHTML = ""; 
     71                document.getElementById('installed_hook_form_contents').innerHTML = ""; 
    7272                show_init_form(); 
    7373        } 
     
    8585                         
    8686                new Ajax.Updater( 
    87                         'remove_hook_form_content', 
    88                         '${h.url_for(controller="repos", action="get_remove_hook_form_content")}',  
     87                        'installed_hook_form_contents', 
     88                        '${h.url_for(controller="repos", action="get_installed_hook_form")}',  
    8989                        {asynchronous:true, evalScripts:true, method:'post', 
    9090                                onComplete: 
     
    109109                if (total==1) 
    110110                { 
    111                         document.getElementById('new_hook_list_box').style.visibility = 'hidden'; 
    112                         document.getElementById('new_hook_list_box').style.position = 'absolute'; 
    113                         document.getElementById('new_hook_setting_box').style.visibility = 'hidden'; 
    114                         document.getElementById('new_hook_setting_box').style.position = 'absolute'; 
     111                        document.getElementById('uninstall_hook_box').style.visibility = 'hidden'; 
     112                        document.getElementById('uninstall_hook_box').style.position = 'absolute'; 
     113                        document.getElementById('hook_setting_box').style.visibility = 'hidden'; 
     114                        document.getElementById('hook_setting_box').style.position = 'absolute'; 
    115115                } 
    116116                else 
    117117                { 
    118                         document.getElementById('new_hook_list_box').style.visibility = 'visible'; 
    119                         document.getElementById('new_hook_list_box').style.position = 'relative'; 
     118                        document.getElementById('uninstall_hook_box').style.visibility = 'visible'; 
     119                        document.getElementById('uninstall_hook_box').style.position = 'relative'; 
    120120                        for (var i=0; i < total; i++) 
    121121                        { 
     
    133133function select_unset_hook_list() 
    134134{ 
     135        var pluginname = document.main_form.unset_plugin_list.value; 
     136 
     137        if (pluginname=='...'||pluginname=='') 
     138        { 
     139                document.getElementById('hook_setting_form_contents').innerHTML = ""; 
     140                document.getElementById('hook_setting_box').style.visibility = 'hidden'; 
     141                document.getElementById('hook_setting_box').style.position = 'absolute'; 
     142        } 
     143        else 
     144        { 
     145                show_hook_config_form(pluginname); 
     146        } 
     147} 
     148 
     149function show_hook_config_form(hookid) 
     150{ 
    135151        var reposname  = document.main_form.repos_list.value; 
    136         var pluginname = document.main_form.unset_plugin_list.value; 
    137         var params = {repos:reposname, plugin:pluginname}; 
    138  
    139         if (pluginname=='...'||pluginname=='') 
    140         { 
    141                 document.getElementById('apply_new_hook_form_content').innerHTML = ""; 
    142                 document.getElementById('new_hook_setting_box').style.visibility = 'hidden'; 
    143                 document.getElementById('new_hook_setting_box').style.position = 'absolute'; 
    144         } 
    145         else 
    146         { 
    147                 document.getElementById('new_hook_setting_box').style.visibility = 'visible'; 
    148                 document.getElementById('new_hook_setting_box').style.position = 'relative'; 
    149                 showNoticesPopup(); 
    150                 new Ajax.Updater( 
    151                         {success:'apply_new_hook_form_content',failure:'apply_new_hook_form_content'}, 
    152                         '${h.url_for(controller="repos", action="get_hook_form")}',  
    153                         {asynchronous:true, evalScripts:true, method:'post', 
    154                                 onComplete: 
    155                                         function(request) 
    156                                                 {hideNoticesPopup();}, 
    157                                 parameters:params 
    158                         }); 
    159         } 
    160 } 
    161  
    162 function apply_new_hook_form_submit(form) 
    163 { 
    164         var reposname  = document.main_form.repos_list.value; 
    165         var pluginname = document.main_form.unset_plugin_list.value; 
    166         if (pluginname=='...'||pluginname==''||reposname=="..."||reposname=="") 
    167         { 
    168                 alert("Bad repository or plugin name"); 
    169                 return false; 
    170         } 
    171         form._repos.value = reposname; 
    172         form._plugin.value = pluginname; 
    173 } 
    174  
    175 function remove_hook_form_submit(form) 
     152        var params = {repos:reposname, plugin:hookid}; 
     153         
     154        document.getElementById('hook_setting_box').style.visibility = 'visible'; 
     155        document.getElementById('hook_setting_box').style.position = 'relative'; 
     156        showNoticesPopup(); 
     157        new Ajax.Updater( 
     158                {success:'hook_setting_form_contents',failure:'message'}, 
     159                '${h.url_for(controller="repos", action="get_hook_setting_form")}',  
     160                {asynchronous:true, evalScripts:true, method:'post', 
     161                        onComplete: 
     162                                function(request) 
     163                                        {hideNoticesPopup();}, 
     164                        parameters:params 
     165                }); 
     166} 
     167 
     168function installed_hook_form_submit(form) 
    176169{ 
    177170        var reposname  = document.main_form.repos_list.value; 
     
    200193</DIV> 
    201194 
    202 <DIV id="new_hook_list_box" class=gainlayout style="visibility:hidden;position:absolute"> 
     195<DIV id="uninstall_hook_box" class=gainlayout style="visibility:hidden;position:absolute"> 
    203196<hr> 
    204197${_("Uninstalled hooks:")} 
     
    207200</form> 
    208201</DIV> 
    209 <DIV id="new_hook_setting_box" class=gainlayout style="visibility:hidden;position:absolute"> 
    210 ## <form name="apply_new_hook_form" method="post" action="${h.url_for(action='apply_new_hook')}" 
    211 ##       onSubmit="apply_new_hook_form_submit(this)"> 
     202<DIV id="hook_setting_box" class=gainlayout style="visibility:hidden;position:absolute"> 
     203## <form name="hook_setting_form" method="post" action="${h.url_for(action='setup_hook')}"> 
     204<br> 
    212205<% 
    213206    context.write(  
    214207        h.form_remote_tag( 
    215             html={'id':'apply_new_hook_form'},  
    216             url=h.url(action='apply_new_hook'),  
     208            html={'id':'hook_setting_form'},  
     209            url=h.url(action='setup_hook'),  
    217210            update="message",  
    218             method='post', before='apply_new_hook_form_submit(this); showNoticesPopup()', 
     211            method='post', before='showNoticesPopup()', 
    219212            complete='hideNoticesPopup();switch_message_box();repos_changed()', 
    220213        ) 
    221214    ) 
    222215 %> 
    223     <input type=hidden name="_repos" value=""> 
    224     <input type=hidden name="_plugin" value=""> 
    225     <div id="apply_new_hook_form_content"></div> 
    226     <input type="submit" name="apply" value="${_("Enable this hook")}"> 
     216    <table class='hidden' width='90%'> 
     217      <tr> 
     218        <td> 
     219          <div id="hook_setting_form_contents"></div> 
     220        </td></tr> 
     221      <tr> 
     222        <td align='center'> 
     223          <input type="submit" name="apply" value="${_("Install this plugin")}"> 
     224        </td> 
     225      </tr> 
     226    </table> 
    227227</form> 
    228228</DIV> 
     
    230230<hr size='1'> 
    231231 
    232 <DIV id="remove_hook_box" class=gainlayout style="visibility:visible;position:relative"> 
    233 ## <form name="remove_hook_form" method="post" action="${h.url_for(action='remove_hook')}" 
    234 ##       onSubmit="remove_hook_form_submit(this)"> 
     232<DIV id="installed_hook_box" class=gainlayout style="visibility:visible;position:relative"> 
     233## <form name="installed_hook_form" method="post" action="${h.url_for(action='remove_hook')}" 
     234##       onSubmit="installed_hook_form_submit(this)"> 
    235235<% 
    236236    context.write(  
    237237        h.form_remote_tag( 
    238             html={'id':'remove_hook_form'},  
    239             url=h.url(action='remove_hook'),  
     238            html={'id':'installed_hook_form'},  
     239            url=h.url(action='uninstall_hook'),  
    240240            update="message", 
    241             method='post', before='remove_hook_form_submit(this); showNoticesPopup()', 
     241            method='post', before='installed_hook_form_submit(this); showNoticesPopup()', 
    242242            complete='hideNoticesPopup();switch_message_box();repos_changed()', 
    243243        ) 
    244244    ) 
    245245 %> 
    246     <input type=hidden name="_repos" value=""> 
    247     <div id="remove_hook_form_content"></div> 
    248 </DIV> 
    249  
    250 </DIV> 
    251  
     246        <input type='hidden' name='_repos'> 
     247    <div id="installed_hook_form_contents"></div> 
     248</DIV> 
     249 
     250</DIV> 
     251 
  • trunk/pysvnmanager/tests/functional/test_repos.py

    r45 r46  
    2828        res = self.app.get(url_for(controller='repos')) 
    2929        assert res.status == 200 
    30         assert """<div id="remove_hook_form_content"></div>""" in res.body, res.body[:100] 
     30        assert """<div id="installed_hook_form_contents"></div>""" in res.body, res.body[:100] 
    3131 
    3232    def test_init_repos_list(self): 
     
    5353        assert "Please choose..." in res.body, res.body 
    5454     
    55     def test_get_remove_hook_form_content(self): 
     55    def test_get_installed_hook_form(self): 
    5656        self.login('root') 
    5757        params = { 
    5858                  'select':'project1',  
    5959                  } 
    60         res = self.app.get(url_for(controller='repos', action="get_remove_hook_form_content"), params) 
     60        res = self.app.get(url_for(controller='repos', action="get_installed_hook_form"), params) 
    6161        assert res.status == 200 
    6262        assert "" == res.body, res.body 
    6363 
    64     def test_get_hook_form(self): 
     64    def test_get_hook_setting_form(self): 
    6565        self.login('root') 
    6666        params = { 
     
    6868                  'plugin':'CaseInsensitive', 
    6969                  } 
    70         res = self.app.get(url_for(controller='repos', action="get_hook_form"), params) 
     70        res = self.app.get(url_for(controller='repos', action="get_hook_setting_form"), params) 
    7171        assert res.status == 200 
    7272        assert "A pre-commit hook to detect case-insensitive filename clashes." in res.body, res.body 
     
    7878                  '_plugin':'CaseInsensitiveXXX', 
    7979                  } 
    80         res = self.app.get(url_for(controller='repos', action="apply_new_hook"), params) 
     80        res = self.app.get(url_for(controller='repos', action="setup_hook"), params) 
    8181        assert res.status == 200 
    8282        assert "Apply plugin 'CaseInsensitiveXXX' on 'project1' Failed" in res.body, res.body 
     
    9797                  '_plugin':'CaseInsensitive', 
    9898                  } 
    99         res = self.app.get(url_for(controller='repos', action="apply_new_hook"), params) 
     99        res = self.app.get(url_for(controller='repos', action="setup_hook"), params) 
    100100        assert res.status == 200 
    101101        assert "<div class='info'>Apply plugin 'CaseInsensitive' on 'project1' success.</div>" == res.body, res.body 
     
    116116                  '_plugin':'EolStyleCheck', 
    117117                  } 
    118         res = self.app.get(url_for(controller='repos', action="apply_new_hook"), params) 
     118        res = self.app.get(url_for(controller='repos', action="setup_hook"), params) 
    119119        assert res.status == 200 
    120120        assert """<div class='info'>Apply plugin 'EolStyleCheck' on 'project1' success.</div>""" == res.body, res.body 
     
    136136                  'pluginid_1':'EolStyleCheck', 
    137137                  } 
    138         res = self.app.get(url_for(controller='repos', action="remove_hook"), params) 
     138        res = self.app.get(url_for(controller='repos', action="uninstall_hook"), params) 
    139139        assert res.status == 200 
    140140        assert """<div class='info'>Delete plugin 'CaseInsensitive, EolStyleCheck' on 'project1' success.</div>""" == res.body, res.body 
  • trunk/pysvnmanager/tests/test_repos.py

    r45 r46  
    7070 
    7171    def testPluginList(self): 
    72         self.assert_(plugins.modules==['CaseInsensitive', 'EolStyleCheck'], plugins.modules) 
     72        self.assert_('CaseInsensitive' in plugins.modules, plugins.modules) 
     73        self.assert_('EolStyleCheck' in plugins.modules, plugins.modules) 
    7374       
    7475    def testPluginImport(self): 
     
    9192         
    9293        myhooks = hooks.Hooks(self.repos_root + '/project1') 
    93         self.assert_(myhooks.pluginnames==['CaseInsensitive', 'EolStyleCheck'], myhooks.pluginnames) 
    94         self.assert_(myhooks.unapplied_plugins.keys()==['CaseInsensitive', 'EolStyleCheck'], myhooks.unapplied_plugins.keys()) 
     94        self.assert_('CaseInsensitive' in myhooks.pluginnames, myhooks.pluginnames) 
     95        self.assert_('EolStyleCheck' in myhooks.pluginnames, myhooks.pluginnames) 
     96         
     97        self.assert_('CaseInsensitive' in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
     98        self.assert_('EolStyleCheck' in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
    9599         
    96100        m = myhooks.plugins['CaseInsensitive'] 
     
    103107        m = myhooks.plugins['CaseInsensitive'] 
    104108        self.assert_(m.enabled()==False) 
    105         self.assert_(myhooks.applied_plugins.keys()==[], myhooks.applied_plugins.keys()) 
    106         self.assert_(myhooks.unapplied_plugins.keys()==['CaseInsensitive', 'EolStyleCheck'], myhooks.unapplied_plugins.keys()) 
     109        self.assert_('CaseInsensitive' not in myhooks.applied_plugins.keys(), myhooks.applied_plugins.keys()) 
     110        self.assert_('EolStyleCheck' not in myhooks.applied_plugins.keys(), myhooks.applied_plugins.keys()) 
     111        self.assert_('CaseInsensitive' in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
     112        self.assert_('EolStyleCheck' in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
    107113 
    108114        m.install() 
    109115        self.assert_(m.enabled()==True) 
    110         self.assert_(myhooks.applied_plugins.keys()==['CaseInsensitive'], myhooks.applied_plugins.keys()) 
    111         self.assert_(myhooks.unapplied_plugins.keys()==['EolStyleCheck'], myhooks.unapplied_plugins.keys()) 
     116        self.assert_('CaseInsensitive' in myhooks.applied_plugins.keys(), myhooks.applied_plugins.keys()) 
     117        self.assert_('EolStyleCheck' not in myhooks.applied_plugins.keys(), myhooks.applied_plugins.keys()) 
     118        self.assert_('CaseInsensitive' not in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
     119        self.assert_('EolStyleCheck' in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
    112120 
    113121        m.uninstall() 
    114122        self.assert_(m.enabled()==False) 
    115         self.assert_(myhooks.applied_plugins.keys()==[], myhooks.applied_plugins.keys()) 
    116         self.assert_(myhooks.unapplied_plugins.keys()==['CaseInsensitive', 'EolStyleCheck'], myhooks.unapplied_plugins.keys()) 
     123        self.assert_('CaseInsensitive' not in myhooks.applied_plugins.keys(), myhooks.applied_plugins.keys()) 
     124        self.assert_('EolStyleCheck' not in myhooks.applied_plugins.keys(), myhooks.applied_plugins.keys()) 
     125        self.assert_('CaseInsensitive' in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
     126        self.assert_('EolStyleCheck' in myhooks.unapplied_plugins.keys(), myhooks.unapplied_plugins.keys()) 
    117127 
    118128