[Pysvnmanager-svn] SF.net SVN: pysvnmanager:[45] trunk
Status: Alpha
Brought to you by:
jiangx
From: <ji...@us...> - 2008-08-26 16:18:28
|
Revision: 45 http://pysvnmanager.svn.sourceforge.net/pysvnmanager/?rev=45&view=rev Author: jiangx Date: 2008-08-26 16:18:33 +0000 (Tue, 26 Aug 2008) Log Message: ----------- add unittest; i18n; refactor plugins Modified Paths: -------------- trunk/config/Makefile trunk/development.ini trunk/pySvnManager.egg-info/paste_deploy_config.ini_tmpl trunk/pysvnmanager/controllers/authz.py trunk/pysvnmanager/controllers/check.py trunk/pysvnmanager/controllers/logs.py trunk/pysvnmanager/controllers/repos.py trunk/pysvnmanager/controllers/role.py trunk/pysvnmanager/hooks/plugins/CaseInsensitive.py trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py trunk/pysvnmanager/hooks/plugins/__init__.py trunk/pysvnmanager/i18n/en/LC_MESSAGES/pysvnmanager.po trunk/pysvnmanager/i18n/pysvnmanager.pot trunk/pysvnmanager/i18n/zh/LC_MESSAGES/pysvnmanager.po trunk/pysvnmanager/model/hooks.py trunk/pysvnmanager/model/repos.py trunk/pysvnmanager/model/svnauthz.py trunk/pysvnmanager/templates/authz/index.mako trunk/pysvnmanager/templates/base.mako trunk/pysvnmanager/templates/check/index.mako trunk/pysvnmanager/templates/repos/hooks.mako trunk/pysvnmanager/templates/role/index.mako trunk/pysvnmanager/tests/functional/test_authz.py trunk/pysvnmanager/tests/functional/test_check.py trunk/pysvnmanager/tests/functional/test_repos.py trunk/pysvnmanager/tests/test_repos.py trunk/test.ini Added Paths: ----------- trunk/pysvnmanager/public/css/ trunk/pysvnmanager/public/css/common.css trunk/pysvnmanager/public/img/ trunk/pysvnmanager/public/img/alert.png trunk/pysvnmanager/public/img/attention.png trunk/pysvnmanager/public/img/icon-error.png trunk/pysvnmanager/public/img/icon-info.png trunk/pysvnmanager/tests/data/ trunk/pysvnmanager/tests/data/svnroot.tar.bz2 Modified: trunk/config/Makefile =================================================================== --- trunk/config/Makefile 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/config/Makefile 2008-08-26 16:18:33 UTC (rev 45) @@ -2,7 +2,7 @@ SRCDIR=../pysvnmanager/config CONFFILE=localconfig.py svn.access svn.passwd svn.access.test svn.passwd.test -all: $(CONFFILE) +all: $(CONFFILE) ../svnroot.test clean: @-rm $(CONFFILE) >/dev/null 2>&1 @@ -15,5 +15,9 @@ %.test: $(SRCDIR)/%.in cp $< $@ +../svnroot.test: ../pysvnmanager/tests/data/svnroot.tar.bz2 + @if [ ! -d $@ ]; then \ + tar -C .. -jxvf $< ; \ + fi .PHONY : all clean Modified: trunk/development.ini =================================================================== --- trunk/development.ini 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/development.ini 2008-08-26 16:18:33 UTC (rev 45) @@ -55,7 +55,7 @@ authz_file = %(here)s/config/svn.access # svn repository root path -repos_root = %(here)s/svnroot/ +repos_root = %(here)s/svnroot #[filter:proxy-prefix] #use = egg:PasteDeploy#prefix @@ -77,7 +77,7 @@ [logger_pysvnmanager] level = DEBUG -handlers = console +handlers = qualname = pysvnmanager [handler_console] Modified: trunk/pySvnManager.egg-info/paste_deploy_config.ini_tmpl =================================================================== --- trunk/pySvnManager.egg-info/paste_deploy_config.ini_tmpl 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pySvnManager.egg-info/paste_deploy_config.ini_tmpl 2008-08-26 16:18:33 UTC (rev 45) @@ -49,6 +49,8 @@ # authz_file: svn authz config file with administrative extension. (ossxp.com) authz_file = %(here)s/config/svn.access +# svn repository root path +repos_root = %(here)s/svnroot #[filter:proxy-prefix] #use = egg:PasteDeploy#prefix @@ -56,7 +58,7 @@ # Logging configuration [loggers] -keys = root +keys = root, pysvnmanager [handlers] keys = console @@ -68,6 +70,11 @@ level = INFO handlers = console +[logger_pysvnmanager] +level = DEBUG +handlers = +qualname = pysvnmanager + [handler_console] class = StreamHandler args = (sys.stderr,) Modified: trunk/pysvnmanager/controllers/authz.py =================================================================== --- trunk/pysvnmanager/controllers/authz.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/controllers/authz.py 2008-08-26 16:18:33 UTC (rev 45) @@ -3,6 +3,7 @@ from pysvnmanager.lib.base import * from pysvnmanager.model.svnauthz import * +from pysvnmanager.model import repos as _repos log = logging.getLogger(__name__) @@ -14,8 +15,20 @@ self.login_as = session.get('user') # Used as checked in user to rcs file. self.authz.login_as = self.login_as - self.reposlist = self.authz.get_manageable_repos_list(self.login_as) + self.reposlist = set(self.authz.get_manageable_repos_list(self.login_as)) + # self.reposlist_new is what in ReposRoot directory. + self.reposlist_real = set(_repos.Repos(cfg.repos_root).repos_list) + self.reposlist_real.add('/') + + self.reposlist_set = self.reposlist & self.reposlist_real + self.reposlist_unexist = self.reposlist - self.reposlist_real + + if self.authz.is_super_user(self.login_as): + self.reposlist_unset = self.reposlist_real - self.reposlist + else: + self.reposlist_unset = set() + def __before__(self, action): super(AuthzController, self).__before__(action) if not self.reposlist: @@ -23,6 +36,7 @@ def index(self): c.revision = self.authz.version + # used for functional test. c.reposlist = self.reposlist all_avail_users = [] @@ -53,10 +67,18 @@ msg += 'id[0]="%s";' % '...' msg += 'name[0]="%s";\n' % _("Please choose...") total += 1; - for reposname in self.reposlist: + for reposname in sorted(self.reposlist_set): msg += 'id[%d]="%s";' % (total, reposname) msg += 'name[%d]="%s";\n' % (total, reposname) total += 1; + for reposname in sorted(self.reposlist_unexist): + msg += 'id[%d]="%s";' % (total, reposname) + msg += 'name[%d]="%s";\n' % (total, reposname+' (?)') + total += 1; + for reposname in sorted(self.reposlist_unset): + msg += 'id[%d]="%s";' % (total, reposname) + msg += 'name[%d]="%s";\n' % (total, reposname+' (!)') + total += 1; msg += 'total=%d;\n' % total msg += 'revision="%s";\n' % self.authz.version return msg @@ -67,6 +89,9 @@ d = request.params select = d.get('select') repos = self.authz.get_repos(select) + if not repos: + log.warning("Repos '%s' not exists. Create authz config automatically." % select) + repos = self.authz.add_repos(select) if repos: # get javascript code for top_form's role_selector @@ -140,6 +165,10 @@ repos = self.authz.add_repos(reposname) else: repos = self.authz.get_repos(reposname) + if not repos: + log.warning("Repos '%s' not exists. Create authz config automatically." % reposname) + repos = self.authz.add_repos(reposname) + if not repos: raise Exception, _("Repository %s not exist.") % reposname @@ -163,7 +192,7 @@ self.authz.set_rules(reposname, path, rules); self.authz.save(revision, comment=log_message) except Exception, e: - msg = get_unicode(e[0]) + msg = get_unicode(e.message) log.info(log_message) if msg: log.error(msg) @@ -186,7 +215,7 @@ self.authz.del_module(reposname, path); self.authz.save(revision, comment=log_message) except Exception, e: - msg = get_unicode(e[0]) + msg = get_unicode(e.message) log.info(log_message) if msg: log.error(msg) Modified: trunk/pysvnmanager/controllers/check.py =================================================================== --- trunk/pysvnmanager/controllers/check.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/controllers/check.py 2008-08-26 16:18:33 UTC (rev 45) @@ -3,6 +3,7 @@ from pysvnmanager.lib.base import * from pysvnmanager.model.svnauthz import * +from pysvnmanager.model import repos as _repos log = logging.getLogger(__name__) @@ -15,6 +16,11 @@ # Used as checked in user to rcs file. self.authz.login_as = self.login_as self.reposlist = self.authz.get_manageable_repos_list(self.login_as) + if self.authz.is_super_user(self.login_as): + for i in _repos.Repos(cfg.repos_root).repos_list: + if i not in self.reposlist: + self.reposlist.append(i) + self.reposlist = sorted(self.reposlist) def __before__(self, action): super(CheckController, self).__before__(action) Modified: trunk/pysvnmanager/controllers/logs.py =================================================================== --- trunk/pysvnmanager/controllers/logs.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/controllers/logs.py 2008-08-26 16:18:33 UTC (rev 45) @@ -155,7 +155,7 @@ self.rcslog.restore(id) self.rcslog.backup(comment=log_message, user=self.login_as) except Exception, e: - msg = "%s" % e + msg = e.message if isinstance(msg, str): msg = unicode(msg, 'utf-8') c.msg = _("Rollback failed: %s") % msg Modified: trunk/pysvnmanager/controllers/repos.py =================================================================== --- trunk/pysvnmanager/controllers/repos.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/controllers/repos.py 2008-08-26 16:18:33 UTC (rev 45) @@ -50,7 +50,7 @@ def get_plugin_list(self): reposname = request.params.get('select') - h = _hooks.Hooks(self.repos_root + reposname) + h = _hooks.Hooks(self.repos_root + '/' + reposname) total = 0; msg = '' @@ -68,23 +68,31 @@ def get_remove_hook_form_content(self): reposname = request.params.get('select') - h = _hooks.Hooks(self.repos_root + reposname) + h = _hooks.Hooks(self.repos_root + '/' + reposname) msg = '' if len(h.applied_plugins) > 0: msg += _("Installed hooks:") msg += "<br>\n" num = 0 - + + msg += "<table class='hidden'>\n" + msg += "<tr><th align='left'></th>" + \ + "<th align='left'>" + _("Id") + "</th>" + \ + "<th align='left'>" + _("Plugin name") + "</th>" + \ + "<th align='left'>" + _("Type") + "</th>" + \ + "</tr>\n" for name in h.applied_plugins.keys(): + msg += "<tr><td width='1' rolspan='2'>" msg += '<input type="checkbox" name="pluginid_%(num)d" value="%(plugin)s">' % { 'num': num, 'plugin': name, } - desc = h.plugins[name].description - detail = h.plugins[name].detail - msg += '%(plugin)s - %(desc)s' % { - 'plugin': name, 'name': h.plugins[name].name, 'desc': desc, } - if detail and detail != desc: - msg += ' - %(detail)s' % { 'detail': detail, } - msg += '<br>\n' + msg += "</td>\n" + msg += "<td>" + name + "</td>\n" + msg += "<td>" + h.plugins[name].name + "</td>\n" + msg += "<td>" + h.plugins[name].get_type() + "</td>\n" + msg += "</tr>\n" + msg += "<tr><td></td><td colspan='3'>" + h.plugins[name].detail + "</td></tr>\n" + num += 1 + msg += "</table>\n" msg += '<input type="submit" name="remove_hook" value="%s">\n' % _("Remove selected hooks") return msg @@ -92,42 +100,50 @@ def get_hook_form(self): reposname = request.params.get('repos') pluginname = request.params.get('plugin') - h = _hooks.Hooks(self.repos_root + reposname) + h = _hooks.Hooks(self.repos_root + '/' + reposname) - return h.plugins[pluginname].show_form() + return h.plugins[pluginname].install_config_form() def apply_new_hook(self): try: d = request.params reposname = d.get("_repos") pluginname = d.get("_plugin") - h = _hooks.Hooks(self.repos_root + reposname) + h = _hooks.Hooks(self.repos_root + '/' + reposname) plugin = h.plugins[pluginname] - plugin.set_plugin(d) + plugin.install(d) except Exception, e: - result = _("Apply plugin '%(plugin)s on '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { - "plugin": pluginname, "repos":reposname, "msg": e} + result = "<div class='error'>" + _("Apply plugin '%(plugin)s' on '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { + "plugin": pluginname, "repos":reposname, "msg": e.message} + "</div>" else: - result = _("Apply plugin '%(plugin)s on '%(repos)s' success.") % { - "plugin": pluginname, "repos":reposname} + result = "<div class='info'>" + _("Apply plugin '%(plugin)s' on '%(repos)s' success.") % { + "plugin": pluginname, "repos":reposname} + "</div>" return result def remove_hook(self): - try: - d = request.params - reposname = d.get("_repos") - h = _hooks.Hooks(self.repos_root + reposname) - for i in d.keys(): - if "pluginid_" in i: - pluginname = d[i] - plugin = h.plugins[pluginname] - plugin.delete_plugin() - except Exception, e: - result = _("Delete plugin '%(plugin)s on '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { - "plugin": pluginname, "repos":reposname, "msg": e} + plugin_list=[] + d = request.params + reposname = d.get("_repos") + for i in d.keys(): + if "pluginid_" in i: + plugin_list.append(d[i]) + + if plugin_list: + log.debug("plugin_list:" + ','.join(plugin_list)) + try: + hookobj = _hooks.Hooks(self.repos_root + '/' + reposname) + for pluginname in plugin_list: + hookobj.plugins[pluginname].reload() + hookobj.plugins[pluginname].uninstall() + log.info("my delete plugin %s, %s" % (pluginname, hookobj.plugins[pluginname].name)) + except Exception, e: + result = "<div class='error'>" + _("Delete plugin '%(plugin)s' on '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { + "plugin": ", ".join(plugin_list), "repos":reposname, "msg": e.message} + "</div>" + else: + result = "<div class='info'>" + _("Delete plugin '%(plugin)s' on '%(repos)s' success.") % { + "plugin": ", ".join(plugin_list), "repos":reposname} + "</div>" else: - result = _("Delete plugin '%(plugin)s on '%(repos)s' success.") % { - "plugin": pluginname, "repos":reposname} + result = "<div class='error'>" + _("No plugin has been deleted for '%(repos)s'.") % {"repos":reposname} + "</div>" return result def create_submit(self): @@ -136,10 +152,10 @@ reposname = d.get("reposname") self.repos.create(reposname) except Exception, e: - result = _("Create repository '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { - "repos":reposname, "msg": e} + result = "<div class='error'>" + _("Create repository '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { + "repos":reposname, "msg": e.message} + "</div>" else: - result = _("Create repository '%(repos)s' success.") % {"repos":reposname} + result = "<div class='info'>" + _("Create repository '%(repos)s' success.") % {"repos":reposname} + "</div>" return result def create(self): @@ -152,10 +168,10 @@ reposname = d.get("repos_list") self.repos.delete(reposname) except Exception, e: - result = _("Delete repository '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { - "repos":reposname, "msg": e} + result = "<div class='error'>" + _("Delete repository '%(repos)s' Failed. Error message:<br>\n%(msg)s") % { + "repos":reposname, "msg": e.message} + "</div>" else: - result = _("Delete blank repository '%(repos)s' success.") % {"repos":reposname} + result = "<div class='info'>" + _("Delete blank repository '%(repos)s' success.") % {"repos":reposname} + "</div>" return result def remove(self): Modified: trunk/pysvnmanager/controllers/role.py =================================================================== --- trunk/pysvnmanager/controllers/role.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/controllers/role.py 2008-08-26 16:18:33 UTC (rev 45) @@ -107,7 +107,7 @@ self.authz.set_group(rolename, member_list, autodrop=autodrop) self.authz.save(revision, comment=log_message) except Exception, e: - msg = get_unicode(e[0]) + msg = get_unicode(e.message) log.info(log_message) if msg: log.error(msg) @@ -128,7 +128,7 @@ self.authz.del_group(rolename) self.authz.save(revision, comment=log_message) except Exception, e: - msg = get_unicode(e[0]) + msg = get_unicode(e.message) log.info(log_message) if msg: log.error(msg) @@ -149,7 +149,7 @@ self.authz.add_alias(aliasname, username) self.authz.save(revision, comment=log_message) except Exception, e: - msg = get_unicode(e[0]) + msg = get_unicode(e.message) log.info(log_message) if msg: log.error(msg) @@ -170,7 +170,7 @@ self.authz.del_alias(aliasname) self.authz.save(revision, comment=log_message) except Exception, e: - msg = get_unicode(e[0]) + msg = get_unicode(e.message) log.info(log_message) if msg: log.error(msg) Modified: trunk/pysvnmanager/hooks/plugins/CaseInsensitive.py =================================================================== --- trunk/pysvnmanager/hooks/plugins/CaseInsensitive.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/hooks/plugins/CaseInsensitive.py 2008-08-26 16:18:33 UTC (rev 45) @@ -1,31 +1,65 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from pysvnmanager.hooks.plugins import PluginBase +from pysvnmanager.hooks.plugins import * +from pysvnmanager.hooks.plugins import _ class CaseInsensitive(PluginBase): - name = "check case insensitive" - description = "A pre-commit hook to detect case-insensitive filename clashes." - option = "case_insensitive" + + # Brief name for this plugin. + name = _("check case insensitive") + + # Longer description for this plugin. + description = _("A pre-commit hook to detect case-insensitive filename clashes.") + + # Hooks-plugin type: T_START_COMMIT, ..., T_POST_UNLOCK + type = T_PRE_COMMIT + + # Plugin config option/value in config ini file. + key = "case_insensitive" value = "yes" - def is_set(self): - return self.get_config(self.option) == self.value + def enabled(self): + """ + Return True, if this plugin has been setup. + Simply call 'has_config()'. + """ + return self.has_config() - def show(self): + def get_detail(self): + """ + Show detail informantion if plugin is already installed. + """ return self.description - def show_form(self): - return self.description + 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. - def delete_plugin(self): - self.del_config(self.option) - self.write() + Default: just output description. + """ + return super(CaseInsensitive, self).install_config_form() + + def uninstall(self): + """ + Uninstall hooks-plugin from repository. + Simply call 'unset_config()' and 'save()'. + """ + self.unset_config() + self.save() - def set_plugin(self, form=None): - self.set_config(self.option, self.value) - self.write() + 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. + """ + self.set_config() + self.save() + def execute(repospath=""): """ Generate and return a hooks plugin object @@ -34,4 +68,4 @@ @rtype: Plugin @return: Plugin object """ - return CaseInsensitive(repospath) \ No newline at end of file + return CaseInsensitive(repospath) Modified: trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py =================================================================== --- trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/hooks/plugins/EolStyleCheck.py 2008-08-26 16:18:33 UTC (rev 45) @@ -1,31 +1,65 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from pysvnmanager.hooks.plugins import PluginBase +from pysvnmanager.hooks.plugins import * +from pysvnmanager.hooks.plugins import _ class EolStyleCheck(PluginBase): - name = "mime-type and eol-style check" - description = "New file must provide svn:eol-style if not binary file." - option = "check_eol_style" + + # Brief name for this plugin. + name = _("mime-type and eol-style check") + + # Longer description for this plugin. + description = _("New file must provide svn:eol-style if not binary file.") + + # Hooks-plugin type: T_START_COMMIT, ..., T_POST_UNLOCK + type = T_PRE_COMMIT + + # Plugin config option/value in config ini file. + key = "check_eol_style" value = "yes" - def is_set(self): - return self.get_config(self.option) == self.value + def enabled(self): + """ + Return True, if this plugin has been setup. + Simply call 'has_config()'. + """ + return self.has_config() - def show(self): + def get_detail(self): + """ + Show detail informantion if plugin is already installed. + """ return self.description - def show_form(self): - return self.description + 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. - def delete_plugin(self): - self.del_config(self.option) - self.write() + Default: just output description. + """ + return super(EolStyleCheck, self).install_config_form() + + def uninstall(self): + """ + Uninstall hooks-plugin from repository. + Simply call 'unset_config()' and 'save()'. + """ + self.unset_config() + self.save() - def set_plugin(self, form=None): - self.set_config(self.option, self.value) - self.write() + 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. + """ + self.set_config() + self.save() + def execute(repospath=""): """ Generate and return a hooks plugin object @@ -34,4 +68,4 @@ @rtype: Plugin @return: Plugin object """ - return EolStyleCheck(repospath) \ No newline at end of file + return EolStyleCheck(repospath) Modified: trunk/pysvnmanager/hooks/plugins/__init__.py =================================================================== --- trunk/pysvnmanager/hooks/plugins/__init__.py 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/hooks/plugins/__init__.py 2008-08-26 16:18:33 UTC (rev 45) @@ -1,11 +1,24 @@ -# create a list of extension actions from the package directory +# -*- coding: utf-8 -*- + import ConfigParser import os +import time +import logging +# i18n works only as pysvnmanager (a pylons app) model. +from pylons import config +if config.get('package') and not config.has_key('unittest'): + from pylons.i18n import _ +else: + _ = lambda x:x + +log = logging.getLogger(__name__) + def getPackageModules(packagefile): - """ Return a list of modules for a package, omitting any modules - starting with an underscore. """ + Return a list of modules for a package, omitting any modules + starting with an underscore. + """ import os, re packagedir = os.path.dirname(packagefile) @@ -38,67 +51,223 @@ module = getattr(module, comp) return module +T_START_COMMIT = 1 +T_PRE_COMMIT = 2 +T_POST_COMMIT = 3 +T_PRE_REVPROP_CHANGE = 4 +T_POST_REVPROP_CHANGE = 5 +T_PRE_LOCK = 6 +T_POST_LOCK = 7 +T_PRE_UNLOCK = 8 +T_POST_UNLOCK = 9 class PluginBase(object): """ Base class for hook plugins """ + # Brief name for this plugin. name = "" + + # Longer description for this plugin. description = "" + + # Hooks-plugin type: T_START_COMMIT, ..., T_POST_UNLOCK + type = 0 + # Store file timestamp as plugin revision, avoid config confliction. + # Not edit it manually. + revision = "" + def __init__(self, repospath): + # Test if repository is exists. self.__repospath = repospath if not os.path.exists(self.__repospath): - raise Exception, "repos '%s' not exist!" % os.path.basename(self.__repospath) + raise Exception, _("repos '%s' not exist!") % os.path.basename(self.__repospath) + + # Read configuration from the default config ini file. self.__configfile = "%s/conf/hooks.ini" % self.__repospath - self.cp = ConfigParser.ConfigParser() self.__read_config() - def __read_config(self): - if os.path.exists(self.__configfile): + def __read_config(self, force=False): + # only read config file if out-of-date. + if force or self.__is_outofdate(): + #log.debug("config is outofdate for '%s'." % self.name) + timestamp = os.path.getmtime(self.__configfile) + + # ConfigParser has not cleanup method, so we initial it again. + self.cp = ConfigParser.ConfigParser() self.cp.read(self.__configfile) - else: + + # Set timestamp as revision + self.revision = timestamp + # if config file not exist. + elif not self.revision: + self.cp = ConfigParser.ConfigParser() self.cp.add_section('main') + self.revision = time.time() - def write(self): + def __is_outofdate(self): + """ + Test if timestamp of the config file is the same we load it last time. + """ + if os.path.exists(self.__configfile): + timestamp = os.path.getmtime(self.__configfile) + if not self.revision or self.revision != timestamp: + return True + # not out-of-date if config file not exist, or timestamp not changed. + return False + + def reload(self, force=True): + """ + Reload the default config ini file, if out-of-date. + """ + self.__read_config(force) + + def save(self): + """ + Save config to the default config ini file. + + If the file modified time is different with the time last load, Conflict raises. + """ + # Test if timestamp of the config file is the same we load it last time. + if self.__is_outofdate(): + raise Exception(_("Conflict: plugin '%s' is modified by others.") % self.name) + + # Save to file. fp = open(self.__configfile, 'w') self.cp.write(fp) + fp.close() + + # Update revision as file timestamp. + self.revision = os.path.getmtime(self.__configfile) - def get_config(self, option, default="", section='main'): + def get_config(self, key, default="", section='main'): + """ + Get config from the default config file. + """ if not self.cp.has_section(section): self.cp.add_section(section) - if self.cp.has_option(section, option): - result = self.cp.get(section, option) + if self.cp.has_option(section, key): + result = self.cp.get(section, key) else: result = default return result - def set_config(self, option, value="", section='main'): + def has_config(self): + """ + Test if self.key = self.value is in the default config ini file. + """ + if not hasattr(self, "key") or not hasattr(self, "value"): + raise Exception, _("Plugin not fully implemented.") + + if hasattr(self, "section"): + section = self.section + else: + section = 'main' + + return self.get_config(self.key, section=section) == self.value + + def set_config(self): + """ + add self.key = self.value to default config ini file. + """ + if not hasattr(self, "key") or not hasattr(self, "value"): + raise Exception, _("Plugin not fully implemented.") + + if hasattr(self, "section"): + section = self.section + else: + section = 'main' + if not self.cp.has_section(section): self.cp.add_section(section) - self.cp.set(section, option, value) + self.cp.set(section, self.key, self.value) - def del_config(self, option, section='main'): + def unset_config(self): + """ + Remove self.key from default config ini file. + """ + if not hasattr(self, "key") or not hasattr(self, "value"): + raise Exception, _("Plugin not fully implemented.") + + if hasattr(self, "section"): + section = self.section + else: + section = 'main' + if self.cp.has_section(section): - self.cp.remove_option(section, option) + self.cp.remove_option(section, self.key) + # test if section is blank after remove option. if not self.cp.options(section): self.cp.remove_section(section) - - def is_set(self): - raise Exception, "Not implement." - def show(self): - return self.description + def get_detail(self): + """ + Show detail informantion if plugin is already installed. + """ + if self.enabled(): + return self.description + else: + return "" - detail = property(show) + detail = property(get_detail) - def show_form(self): - return self.description + def get_type(self): + type = "UNDEFINED" + if self.type == T_START_COMMIT: + type = "start-commit" + elif self.type == T_PRE_COMMIT: + type = "pre-commit" + elif self.type == T_POST_COMMIT: + type = "post-commit" + elif self.type == T_PRE_REVPROP_CHANGE: + type = "pre-revprop-change" + elif self.type == T_POST_REVPROP_CHANGE: + type = "post-revprop-change" + elif self.type == T_PRE_LOCK: + type = "pre-lock" + elif self.type == T_POST_LOCK: + type = "post-lock" + elif self.type == T_PRE_UNLOCK: + type = "pre-unlock" + elif self.type == T_POST_UNLOCK: + type = "post-unlock" + return type + + 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. + + Default: just output description. + """ + result = "<ul><li>" + _("Plugin name") + ": " + self.name + "\n" + \ + "<li>" + _("Type") + ": " + self.get_type() + "\n" + \ + "<li>" + _("Description") + ": " + self.description + "\n" + return result + + def enabled(self): + """ + Return True, if this plugin has been setup. + Simply call 'has_config()'. + """ + raise Exception, _("Plugin not fully implemented.") - def delete_plugin(self): - raise Exception, "Not implement." + def uninstall(self): + """ + Uninstall hooks-plugin from repository. + Simply call 'unset_config()' and 'save()'. + """ + raise Exception, _("Plugin not fully implemented.") - def set_plugin(self, form=None): - raise Exception, "Not implement." + 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. + """ + raise Exception, _("Plugin not fully implemented.") modules = getPackageModules(__file__) Modified: trunk/pysvnmanager/i18n/en/LC_MESSAGES/pysvnmanager.po =================================================================== --- trunk/pysvnmanager/i18n/en/LC_MESSAGES/pysvnmanager.po 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/i18n/en/LC_MESSAGES/pysvnmanager.po 2008-08-26 16:18:33 UTC (rev 45) @@ -9,7 +9,7 @@ "Project-Id-Version: pysvnmanager 0.0.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-07-03 22:14+0800\n" -"PO-Revision-Date: 2008-07-31 09:21+0800\n" +"PO-Revision-Date: 2008-08-27 00:06+0800\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: en <LL...@li...>\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" @@ -18,27 +18,27 @@ "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.2\n" -#: pysvnmanager/controllers/authz.py:29 -#: pysvnmanager/templates/authz/index.mako:159 +#: pysvnmanager/controllers/authz.py:43 +#: pysvnmanager/templates/authz/index.mako:152 #: pysvnmanager/templates/check/index.mako:10 msgid "All users(with anon)" msgstr "" -#: pysvnmanager/controllers/authz.py:30 -#: pysvnmanager/templates/authz/index.mako:161 +#: pysvnmanager/controllers/authz.py:44 +#: pysvnmanager/templates/authz/index.mako:154 #: pysvnmanager/templates/check/index.mako:11 msgid "Known users" msgstr "" -#: pysvnmanager/controllers/authz.py:31 -#: pysvnmanager/templates/authz/index.mako:163 +#: pysvnmanager/controllers/authz.py:45 +#: pysvnmanager/templates/authz/index.mako:156 #: pysvnmanager/templates/check/index.mako:12 msgid "Anonymous" msgstr "" -#: pysvnmanager/controllers/authz.py:36 pysvnmanager/controllers/role.py:50 +#: pysvnmanager/controllers/authz.py:50 pysvnmanager/controllers/role.py:50 #: pysvnmanager/controllers/role.py:70 -#: pysvnmanager/templates/authz/index.mako:155 +#: pysvnmanager/templates/authz/index.mako:148 #: pysvnmanager/templates/check/index.mako:17 #: pysvnmanager/templates/role/index.mako:18 #: pysvnmanager/templates/role/index.mako:37 @@ -47,9 +47,9 @@ msgid "Group:" msgstr "" -#: pysvnmanager/controllers/authz.py:39 pysvnmanager/controllers/role.py:55 +#: pysvnmanager/controllers/authz.py:53 pysvnmanager/controllers/role.py:55 #: pysvnmanager/controllers/role.py:72 -#: pysvnmanager/templates/authz/index.mako:157 +#: pysvnmanager/templates/authz/index.mako:150 #: pysvnmanager/templates/check/index.mako:19 #: pysvnmanager/templates/role/index.mako:23 #: pysvnmanager/templates/role/index.mako:42 @@ -58,8 +58,9 @@ msgid "Alias:" msgstr "" -#: pysvnmanager/controllers/authz.py:54 pysvnmanager/controllers/authz.py:74 -#: pysvnmanager/controllers/check.py:83 pysvnmanager/controllers/role.py:43 +#: pysvnmanager/controllers/authz.py:68 pysvnmanager/controllers/authz.py:99 +#: pysvnmanager/controllers/check.py:89 pysvnmanager/controllers/repos.py:40 +#: pysvnmanager/controllers/repos.py:59 pysvnmanager/controllers/role.py:43 #: pysvnmanager/templates/check/index.mako:9 #: pysvnmanager/templates/check/index.mako:23 #: pysvnmanager/templates/role/index.mako:12 @@ -67,31 +68,31 @@ msgid "Please choose..." msgstr "" -#: pysvnmanager/controllers/authz.py:135 +#: pysvnmanager/controllers/authz.py:160 #, python-format msgid "User %(user)s changed authz rules. (rev:%(rev)s)" msgstr "" -#: pysvnmanager/controllers/authz.py:144 +#: pysvnmanager/controllers/authz.py:173 #, python-format msgid "Repository %s not exist." msgstr "" -#: pysvnmanager/controllers/authz.py:152 +#: pysvnmanager/controllers/authz.py:181 #, python-format msgid "Module %s not exist." msgstr "" -#: pysvnmanager/controllers/authz.py:158 +#: pysvnmanager/controllers/authz.py:187 msgid "You can not delete yourself from admin list." msgstr "" -#: pysvnmanager/controllers/authz.py:183 +#: pysvnmanager/controllers/authz.py:212 #, python-format msgid "User %(user)s delete authz rules. (rev:%(rev)s)" msgstr "" -#: pysvnmanager/controllers/check.py:63 +#: pysvnmanager/controllers/check.py:69 #: pysvnmanager/templates/auth_failed.mako:3 msgid "Permission denied." msgstr "" @@ -124,16 +125,91 @@ msgid "Compares between" msgstr "" -#: pysvnmanager/controllers/logs.py:148 +#: pysvnmanager/controllers/logs.py:152 #, python-format msgid "Rollback successfully to revision: %s" msgstr "" -#: pysvnmanager/controllers/logs.py:157 +#: pysvnmanager/controllers/logs.py:161 #, python-format msgid "Rollback failed: %s" msgstr "" +#: pysvnmanager/controllers/repos.py:74 +msgid "Installed hooks:" +msgstr "" + +#: pysvnmanager/controllers/repos.py:80 +msgid "Id" +msgstr "" + +#: pysvnmanager/controllers/repos.py:81 +#: pysvnmanager/hooks/plugins/__init__.py:244 +msgid "Plugin name" +msgstr "" + +#: pysvnmanager/controllers/repos.py:82 +#: pysvnmanager/hooks/plugins/__init__.py:245 +msgid "Type" +msgstr "" + +#: pysvnmanager/controllers/repos.py:96 +msgid "Remove selected hooks" +msgstr "" + +#: pysvnmanager/controllers/repos.py:116 +#, python-format +msgid "" +"Apply plugin '%(plugin)s' on '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:119 +#, python-format +msgid "Apply plugin '%(plugin)s' on '%(repos)s' success." +msgstr "" + +#: pysvnmanager/controllers/repos.py:140 +#, python-format +msgid "" +"Delete plugin '%(plugin)s' on '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:143 +#, python-format +msgid "Delete plugin '%(plugin)s' on '%(repos)s' success." +msgstr "" + +#: pysvnmanager/controllers/repos.py:146 +#, python-format +msgid "No plugin has been deleted for '%(repos)s'." +msgstr "" + +#: pysvnmanager/controllers/repos.py:155 +#, python-format +msgid "" +"Create repository '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:158 +#, python-format +msgid "Create repository '%(repos)s' success." +msgstr "" + +#: pysvnmanager/controllers/repos.py:171 +#, python-format +msgid "" +"Delete repository '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:174 +#, python-format +msgid "Delete blank repository '%(repos)s' success." +msgstr "" + #: pysvnmanager/controllers/role.py:103 #, python-format msgid "User %(user)s changed group: %(grp)s. (rev:%(rev)s)" @@ -169,6 +245,60 @@ msgid "User %s logged out" msgstr "" +#: pysvnmanager/hooks/plugins/CaseInsensitive.py:10 +msgid "check case insensitive" +msgstr "" + +#: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 +msgid "A pre-commit hook to detect case-insensitive filename clashes." +msgstr "" + +#: pysvnmanager/hooks/plugins/EolStyleCheck.py:10 +msgid "mime-type and eol-style check" +msgstr "" + +#: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 +msgid "New file must provide svn:eol-style if not binary file." +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:84 +#, python-format +msgid "repos '%s' not exist!" +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:133 +#, python-format +msgid "Conflict: plugin '%s' is modified by others." +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:160 +#: pysvnmanager/hooks/plugins/__init__.py:174 +#: pysvnmanager/hooks/plugins/__init__.py:190 +#: pysvnmanager/hooks/plugins/__init__.py:254 +#: pysvnmanager/hooks/plugins/__init__.py:261 +#: pysvnmanager/hooks/plugins/__init__.py:270 +msgid "Plugin not fully implemented." +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:246 +msgid "Description" +msgstr "" + +#: pysvnmanager/model/repos.py:39 +#, python-format +msgid "Repos root does not exist: %s" +msgstr "" + +#: pysvnmanager/model/repos.py:68 +#, python-format +msgid "Repos %s already exists." +msgstr "" + +#: pysvnmanager/model/repos.py:137 +#, python-format +msgid "Repos %s is not a blank repository." +msgstr "" + #: pysvnmanager/model/svnauthz.py:61 msgid "Name is not given." msgstr "" @@ -222,22 +352,22 @@ msgid "%s is referenced by [%s]." msgstr "" -#: pysvnmanager/model/svnauthz.py:1770 +#: pysvnmanager/model/svnauthz.py:1769 #, python-format msgid "User %(username)s has Full (RW) rights for module %(repos)s:%(path)s" msgstr "" -#: pysvnmanager/model/svnauthz.py:1772 +#: pysvnmanager/model/svnauthz.py:1771 #, python-format msgid "User %(username)s has ReadOnly (RO) rights for module %(repos)s:%(path)s" msgstr "" -#: pysvnmanager/model/svnauthz.py:1774 +#: pysvnmanager/model/svnauthz.py:1773 #, python-format msgid "User %(username)s can *NOT* access to module %(repos)s:%(path)s" msgstr "" -#: pysvnmanager/model/svnauthz.py:1812 +#: pysvnmanager/model/svnauthz.py:1813 #, python-format msgid "" "\n" @@ -249,7 +379,7 @@ "\n" msgstr "" -#: pysvnmanager/model/svnauthz.py:1831 +#: pysvnmanager/model/svnauthz.py:1832 #, python-format msgid "" "\n" @@ -267,152 +397,163 @@ "%(sep)s\n" msgstr "" -#: pysvnmanager/templates/base.mako:11 +#: pysvnmanager/templates/base.mako:12 msgid "Loading, please wait..." msgstr "" -#: pysvnmanager/templates/base.mako:27 +#: pysvnmanager/templates/base.mako:19 +msgid "Clear message" +msgstr "" + +#: pysvnmanager/templates/base.mako:33 msgid "Check permissions" msgstr "" -#: pysvnmanager/templates/base.mako:28 +#: pysvnmanager/templates/base.mako:34 msgid "Role management" msgstr "" -#: pysvnmanager/templates/base.mako:29 +#: pysvnmanager/templates/base.mako:35 #: pysvnmanager/templates/authz/index.mako:5 -#: pysvnmanager/templates/authz/index.mako:603 +#: pysvnmanager/templates/authz/index.mako:590 msgid "ACL management" msgstr "" -#: pysvnmanager/templates/base.mako:30 -msgid "Logs" +#: pysvnmanager/templates/base.mako:36 +#: pysvnmanager/templates/repos/hooks.mako:5 +#: pysvnmanager/templates/repos/hooks.mako:189 +msgid "Repos management" msgstr "" -#: pysvnmanager/templates/base.mako:32 +#: pysvnmanager/templates/base.mako:37 +msgid "Change log" +msgstr "" + +#: pysvnmanager/templates/base.mako:39 msgid "Logout" msgstr "" -#: pysvnmanager/templates/authz/index.mako:165 +#: pysvnmanager/templates/authz/index.mako:158 msgid "User:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:174 +#: pysvnmanager/templates/authz/index.mako:167 msgid "Readonly" msgstr "" -#: pysvnmanager/templates/authz/index.mako:178 -#: pysvnmanager/templates/authz/index.mako:677 +#: pysvnmanager/templates/authz/index.mako:171 +#: pysvnmanager/templates/authz/index.mako:664 msgid "Full" msgstr "" -#: pysvnmanager/templates/authz/index.mako:182 -#: pysvnmanager/templates/authz/index.mako:678 +#: pysvnmanager/templates/authz/index.mako:175 +#: pysvnmanager/templates/authz/index.mako:665 msgid "Denied" msgstr "" -#: pysvnmanager/templates/authz/index.mako:380 +#: pysvnmanager/templates/authz/index.mako:373 msgid "No rights selected! Please check proper rights for selected users." msgstr "" -#: pysvnmanager/templates/authz/index.mako:391 +#: pysvnmanager/templates/authz/index.mako:384 msgid "Unknown rights: " msgstr "" -#: pysvnmanager/templates/authz/index.mako:479 +#: pysvnmanager/templates/authz/index.mako:472 msgid "Please input module path." msgstr "" -#: pysvnmanager/templates/authz/index.mako:485 +#: pysvnmanager/templates/authz/index.mako:478 msgid "Please input repository name." msgstr "" -#: pysvnmanager/templates/authz/index.mako:490 +#: pysvnmanager/templates/authz/index.mako:483 msgid "Save failed." msgstr "" -#: pysvnmanager/templates/authz/index.mako:510 +#: pysvnmanager/templates/authz/index.mako:503 msgid "Update ACL failed:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:517 +#: pysvnmanager/templates/authz/index.mako:508 msgid "Update ACL successfully." msgstr "" -#: pysvnmanager/templates/authz/index.mako:539 +#: pysvnmanager/templates/authz/index.mako:529 msgid "No path selected." msgstr "" -#: pysvnmanager/templates/authz/index.mako:544 +#: pysvnmanager/templates/authz/index.mako:534 msgid "Are you sure to delete module:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:546 -#: pysvnmanager/templates/role/index.mako:450 -#: pysvnmanager/templates/role/index.mako:541 +#: pysvnmanager/templates/authz/index.mako:536 +#: pysvnmanager/templates/role/index.mako:446 +#: pysvnmanager/templates/role/index.mako:531 msgid "Click Ok to proceed, or click cancel" msgstr "" -#: pysvnmanager/templates/authz/index.mako:567 +#: pysvnmanager/templates/authz/index.mako:557 msgid "Can not delete module " msgstr "" -#: pysvnmanager/templates/authz/index.mako:574 +#: pysvnmanager/templates/authz/index.mako:562 msgid "Successfully delete module:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:610 +#: pysvnmanager/templates/authz/index.mako:597 +#: pysvnmanager/templates/repos/hooks.mako:195 msgid "Repository:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:613 +#: pysvnmanager/templates/authz/index.mako:600 msgid "New repository" msgstr "" -#: pysvnmanager/templates/authz/index.mako:617 +#: pysvnmanager/templates/authz/index.mako:604 msgid "Repository Name:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:622 +#: pysvnmanager/templates/authz/index.mako:609 msgid "Administrators:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:634 +#: pysvnmanager/templates/authz/index.mako:621 msgid "Module:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:637 +#: pysvnmanager/templates/authz/index.mako:624 msgid "New module" msgstr "" -#: pysvnmanager/templates/authz/index.mako:643 +#: pysvnmanager/templates/authz/index.mako:630 msgid "Module Path:" msgstr "" -#: pysvnmanager/templates/authz/index.mako:657 +#: pysvnmanager/templates/authz/index.mako:644 msgid "ACL" msgstr "" -#: pysvnmanager/templates/authz/index.mako:662 +#: pysvnmanager/templates/authz/index.mako:649 msgid "Users" msgstr "" -#: pysvnmanager/templates/authz/index.mako:676 +#: pysvnmanager/templates/authz/index.mako:663 msgid "ReadOnly" msgstr "" -#: pysvnmanager/templates/authz/index.mako:693 -#: pysvnmanager/templates/role/index.mako:727 +#: pysvnmanager/templates/authz/index.mako:678 +#: pysvnmanager/templates/role/index.mako:711 msgid "Save" msgstr "" -#: pysvnmanager/templates/authz/index.mako:694 -#: pysvnmanager/templates/role/index.mako:728 +#: pysvnmanager/templates/authz/index.mako:679 +#: pysvnmanager/templates/role/index.mako:712 msgid "Delete" msgstr "" -#: pysvnmanager/templates/authz/index.mako:695 -#: pysvnmanager/templates/role/index.mako:729 +#: pysvnmanager/templates/authz/index.mako:680 +#: pysvnmanager/templates/role/index.mako:713 msgid "Cancel" msgstr "" @@ -493,7 +634,7 @@ msgstr "" #: pysvnmanager/templates/logs/rollback.mako:14 -#: pysvnmanager/templates/logs/view.mako:18 +#: pysvnmanager/templates/logs/view.mako:20 msgid "Close" msgstr "" @@ -505,88 +646,118 @@ msgid "Rollback to this revision, are you sure?" msgstr "" -#: pysvnmanager/templates/logs/view.mako:16 +#: pysvnmanager/templates/logs/view.mako:17 msgid "Rollback to this revision" msgstr "" +#: pysvnmanager/templates/repos/create.mako:5 +#: pysvnmanager/templates/repos/create.mako:8 +#: pysvnmanager/templates/repos/create.mako:25 +msgid "Create repository" +msgstr "" + +#: pysvnmanager/templates/repos/create.mako:22 +#: pysvnmanager/templates/repos/remove.mako:63 +msgid "Repository name:" +msgstr "" + +#: pysvnmanager/templates/repos/hooks.mako:198 +msgid "Add repository" +msgstr "" + +#: pysvnmanager/templates/repos/hooks.mako:199 +#: pysvnmanager/templates/repos/remove.mako:5 +#: pysvnmanager/templates/repos/remove.mako:49 +#: pysvnmanager/templates/repos/remove.mako:67 +msgid "Remove repository" +msgstr "" + +#: pysvnmanager/templates/repos/hooks.mako:204 +msgid "Uninstalled hooks:" +msgstr "" + +#: pysvnmanager/templates/repos/hooks.mako:226 +msgid "Enable this hook" +msgstr "" + #: pysvnmanager/templates/role/index.mako:5 -#: pysvnmanager/templates/role/index.mako:638 +#: pysvnmanager/templates/role/index.mako:625 msgid "Role Management" msgstr "" -#: pysvnmanager/templates/role/index.mako:420 +#: pysvnmanager/templates/role/index.mako:418 msgid "Update group failed:" msgstr "" -#: pysvnmanager/templates/role/index.mako:427 +#: pysvnmanager/templates/role/index.mako:424 msgid "Update group successfully." msgstr "" -#: pysvnmanager/templates/role/index.mako:448 +#: pysvnmanager/templates/role/index.mako:444 msgid "Are you sure to delete group:" msgstr "" -#: pysvnmanager/templates/role/index.mako:471 +#: pysvnmanager/templates/role/index.mako:467 msgid "Delete group failed:" msgstr "" -#: pysvnmanager/templates/role/index.mako:478 +#: pysvnmanager/templates/role/index.mako:472 msgid "Delete group successfully." msgstr "" -#: pysvnmanager/templates/role/index.mako:512 +#: pysvnmanager/templates/role/index.mako:505 msgid "Update alias failed:" msgstr "" -#: pysvnmanager/templates/role/index.mako:519 +#: pysvnmanager/templates/role/index.mako:510 msgid "Update alias successfully." msgstr "" -#: pysvnmanager/templates/role/index.mako:539 +#: pysvnmanager/templates/role/index.mako:529 msgid "Are you sure to delete alias:" msgstr "" -#: pysvnmanager/templates/role/index.mako:562 +#: pysvnmanager/templates/role/index.mako:552 msgid "Delete alias failed:" msgstr "" -#: pysvnmanager/templates/role/index.mako:569 +#: pysvnmanager/templates/role/index.mako:557 msgid "Delete alias successfully." msgstr "" -#: pysvnmanager/templates/role/index.mako:645 +#: pysvnmanager/templates/role/index.mako:632 msgid "Select a role name:" msgstr "" -#: pysvnmanager/templates/role/index.mako:649 +#: pysvnmanager/templates/role/index.mako:636 msgid "New Group" msgstr "" -#: pysvnmanager/templates/role/index.mako:650 +#: pysvnmanager/templates/role/index.mako:637 msgid "New Alias" msgstr "" -#: pysvnmanager/templates/role/index.mako:654 +#: pysvnmanager/templates/role/index.mako:641 msgid "New group name:" msgstr "" -#: pysvnmanager/templates/role/index.mako:658 +#: pysvnmanager/templates/role/index.mako:645 msgid "New alias name:" msgstr "" -#: pysvnmanager/templates/role/index.mako:670 +#: pysvnmanager/templates/role/index.mako:657 msgid "Members list" msgstr "" -#: pysvnmanager/templates/role/index.mako:675 +#: pysvnmanager/templates/role/index.mako:662 msgid "Other users" msgstr "" -#: pysvnmanager/templates/role/index.mako:694 +#: pysvnmanager/templates/role/index.mako:681 msgid "Ignore recursive" msgstr "" -#: pysvnmanager/templates/role/index.mako:706 +#: pysvnmanager/templates/role/index.mako:693 msgid "User name:" msgstr "" Modified: trunk/pysvnmanager/i18n/pysvnmanager.pot =================================================================== --- trunk/pysvnmanager/i18n/pysvnmanager.pot 2008-08-25 10:27:15 UTC (rev 44) +++ trunk/pysvnmanager/i18n/pysvnmanager.pot 2008-08-26 16:18:33 UTC (rev 45) @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: pySvnManager 0.1.3\n" +"Project-Id-Version: pySvnManager 0.2.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2008-07-31 09:21+0800\n" +"POT-Creation-Date: 2008-08-27 00:06+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL...@li...>\n" @@ -17,23 +17,23 @@ "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.2\n" -#: pysvnmanager/controllers/authz.py:29 pysvnmanager/templates/authz/index.mako:159 +#: pysvnmanager/controllers/authz.py:43 pysvnmanager/templates/authz/index.mako:152 #: pysvnmanager/templates/check/index.mako:10 msgid "All users(with anon)" msgstr "" -#: pysvnmanager/controllers/authz.py:30 pysvnmanager/templates/authz/index.mako:161 +#: pysvnmanager/controllers/authz.py:44 pysvnmanager/templates/authz/index.mako:154 #: pysvnmanager/templates/check/index.mako:11 msgid "Known users" msgstr "" -#: pysvnmanager/controllers/authz.py:31 pysvnmanager/templates/authz/index.mako:163 +#: pysvnmanager/controllers/authz.py:45 pysvnmanager/templates/authz/index.mako:156 #: pysvnmanager/templates/check/index.mako:12 msgid "Anonymous" msgstr "" -#: pysvnmanager/controllers/authz.py:36 pysvnmanager/controllers/role.py:50 -#: pysvnmanager/controllers/role.py:70 pysvnmanager/templates/authz/index.mako:155 +#: pysvnmanager/controllers/authz.py:50 pysvnmanager/controllers/role.py:50 +#: pysvnmanager/controllers/role.py:70 pysvnmanager/templates/authz/index.mako:148 #: pysvnmanager/templates/check/index.mako:17 #: pysvnmanager/templates/role/index.mako:18 #: pysvnmanager/templates/role/index.mako:37 @@ -42,8 +42,8 @@ msgid "Group:" msgstr "" -#: pysvnmanager/controllers/authz.py:39 pysvnmanager/controllers/role.py:55 -#: pysvnmanager/controllers/role.py:72 pysvnmanager/templates/authz/index.mako:157 +#: pysvnmanager/controllers/authz.py:53 pysvnmanager/controllers/role.py:55 +#: pysvnmanager/controllers/role.py:72 pysvnmanager/templates/authz/index.mako:150 #: pysvnmanager/templates/check/index.mako:19 #: pysvnmanager/templates/role/index.mako:23 #: pysvnmanager/templates/role/index.mako:42 @@ -52,8 +52,9 @@ msgid "Alias:" msgstr "" -#: pysvnmanager/controllers/authz.py:54 pysvnmanager/controllers/authz.py:74 -#: pysvnmanager/controllers/check.py:83 pysvnmanager/controllers/role.py:43 +#: pysvnmanager/controllers/authz.py:68 pysvnmanager/controllers/authz.py:99 +#: pysvnmanager/controllers/check.py:89 pysvnmanager/controllers/repos.py:40 +#: pysvnmanager/controllers/repos.py:59 pysvnmanager/controllers/role.py:43 #: pysvnmanager/templates/check/index.mako:9 #: pysvnmanager/templates/check/index.mako:23 #: pysvnmanager/templates/role/index.mako:12 @@ -61,31 +62,31 @@ msgid "Please choose..." msgstr "" -#: pysvnmanager/controllers/authz.py:135 +#: pysvnmanager/controllers/authz.py:160 #, python-format msgid "User %(user)s changed authz rules. (rev:%(rev)s)" msgstr "" -#: pysvnmanager/controllers/authz.py:144 +#: pysvnmanager/controllers/authz.py:173 #, python-format msgid "Repository %s not exist." msgstr "" -#: pysvnmanager/controllers/authz.py:152 +#: pysvnmanager/controllers/authz.py:181 #, python-format msgid "Module %s not exist." msgstr "" -#: pysvnmanager/controllers/authz.py:158 +#: pysvnmanager/controllers/authz.py:187 msgid "You can not delete yourself from admin list." msgstr "" -#: pysvnmanager/controllers/authz.py:183 +#: pysvnmanager/controllers/authz.py:212 #, python-format msgid "User %(user)s delete authz rules. (rev:%(rev)s)" msgstr "" -#: pysvnmanager/controllers/check.py:63 pysvnmanager/templates/auth_failed.mako:3 +#: pysvnmanager/controllers/check.py:69 pysvnmanager/templates/auth_failed.mako:3 msgid "Permission denied." msgstr "" @@ -117,16 +118,89 @@ msgid "Compares between" msgstr "" -#: pysvnmanager/controllers/logs.py:148 +#: pysvnmanager/controllers/logs.py:152 #, python-format msgid "Rollback successfully to revision: %s" msgstr "" -#: pysvnmanager/controllers/logs.py:157 +#: pysvnmanager/controllers/logs.py:161 #, python-format msgid "Rollback failed: %s" msgstr "" +#: pysvnmanager/controllers/repos.py:74 +msgid "Installed hooks:" +msgstr "" + +#: pysvnmanager/controllers/repos.py:80 +msgid "Id" +msgstr "" + +#: pysvnmanager/controllers/repos.py:81 pysvnmanager/hooks/plugins/__init__.py:244 +msgid "Plugin name" +msgstr "" + +#: pysvnmanager/controllers/repos.py:82 pysvnmanager/hooks/plugins/__init__.py:245 +msgid "Type" +msgstr "" + +#: pysvnmanager/controllers/repos.py:96 +msgid "Remove selected hooks" +msgstr "" + +#: pysvnmanager/controllers/repos.py:116 +#, python-format +msgid "" +"Apply plugin '%(plugin)s' on '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:119 +#, python-format +msgid "Apply plugin '%(plugin)s' on '%(repos)s' success." +msgstr "" + +#: pysvnmanager/controllers/repos.py:140 +#, python-format +msgid "" +"Delete plugin '%(plugin)s' on '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:143 +#, python-format +msgid "Delete plugin '%(plugin)s' on '%(repos)s' success." +msgstr "" + +#: pysvnmanager/controllers/repos.py:146 +#, python-format +msgid "No plugin has been deleted for '%(repos)s'." +msgstr "" + +#: pysvnmanager/controllers/repos.py:155 +#, python-format +msgid "" +"Create repository '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:158 +#, python-format +msgid "Create repository '%(repos)s' success." +msgstr "" + +#: pysvnmanager/controllers/repos.py:171 +#, python-format +msgid "" +"Delete repository '%(repos)s' Failed. Error message:<br>\n" +"%(msg)s" +msgstr "" + +#: pysvnmanager/controllers/repos.py:174 +#, python-format +msgid "Delete blank repository '%(repos)s' success." +msgstr "" + #: pysvnmanager/controllers/role.py:103 #, python-format msgid "User %(user)s changed group: %(grp)s. (rev:%(rev)s)" @@ -162,6 +236,60 @@ msgid "User %s logged out" msgstr "" +#: pysvnmanager/hooks/plugins/CaseInsensitive.py:10 +msgid "check case insensitive" +msgstr "" + +#: pysvnmanager/hooks/plugins/CaseInsensitive.py:13 +msgid "A pre-commit hook to detect case-insensitive filename clashes." +msgstr "" + +#: pysvnmanager/hooks/plugins/EolStyleCheck.py:10 +msgid "mime-type and eol-style check" +msgstr "" + +#: pysvnmanager/hooks/plugins/EolStyleCheck.py:13 +msgid "New file must provide svn:eol-style if not binary file." +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:84 +#, python-format +msgid "repos '%s' not exist!" +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:133 +#, python-format +msgid "Conflict: plugin '%s' is modified by others." +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:160 +#: pysvnmanager/hooks/plugins/__init__.py:174 +#: pysvnmanager/hooks/plugins/__init__.py:190 +#: pysvnmanager/hooks/plugins/__init__.py:254 +#: pysvnmanager/hooks/plugins/__init__.py:261 +#: pysvnmanager/hooks/plugins/__init__.py:270 +msgid "Plugin not fully implemented." +msgstr "" + +#: pysvnmanager/hooks/plugins/__init__.py:246 +msgid "Description" +msgstr "" + +#: pysvnmanager/model/repos.py:39 +#, python-format +msgid "Repos root does not exist: %s" +msgstr "" + +#: pysvnmanager/model/repos.py:68 +#, python-format +msgid "Repos %s already exists.... [truncated message content] |