diff --git a/rhodecode/controllers/admin/ldap_settings.py b/rhodecode/controllers/admin/ldap_settings.py --- a/rhodecode/controllers/admin/ldap_settings.py +++ b/rhodecode/controllers/admin/ldap_settings.py @@ -64,9 +64,7 @@ class LdapSettingsController(BaseControl force_defaults=True,) def ldap_settings(self): - """ - POST ldap create and store ldap settings - """ + """POST ldap create and store ldap settings""" settings_model = SettingsModel() _form = LdapSettingsForm()() @@ -100,7 +98,7 @@ class LdapSettingsController(BaseControl encoding="UTF-8") except Exception: log.error(traceback.format_exc()) - h.flash(_('error occured during update of ldap settings'), + h.flash(_('error occurred during update of ldap settings'), category='error') return redirect(url('ldap_home')) diff --git a/rhodecode/controllers/admin/permissions.py b/rhodecode/controllers/admin/permissions.py --- a/rhodecode/controllers/admin/permissions.py +++ b/rhodecode/controllers/admin/permissions.py @@ -120,7 +120,7 @@ class PermissionsController(BaseControll encoding="UTF-8") except Exception: log.error(traceback.format_exc()) - h.flash(_('error occured during update of permissions'), + h.flash(_('error occurred during update of permissions'), category='error') return redirect(url('edit_permission', id=id)) diff --git a/rhodecode/controllers/admin/repos.py b/rhodecode/controllers/admin/repos.py --- a/rhodecode/controllers/admin/repos.py +++ b/rhodecode/controllers/admin/repos.py @@ -107,7 +107,7 @@ class ReposController(BaseController): except Exception: log.error(traceback.format_exc()) - msg = _('error occured during creation of repository %s') \ + msg = _('error occurred during creation of repository %s') \ % form_result.get('repo_name') h.flash(msg, category='error') if request.POST.get('user_created'): @@ -206,7 +206,7 @@ class ReposController(BaseController): except Exception, e: log.error(traceback.format_exc()) - h.flash(_('An error occured during deletion of %s') % repo_name, + h.flash(_('An error occurred during deletion of %s') % repo_name, category='error') return redirect(url('repos')) @@ -222,7 +222,7 @@ class ReposController(BaseController): repo_model = RepoModel() repo_model.delete_perm_user(request.POST, repo_name) except Exception, e: - h.flash(_('An error occured during deletion of repository user'), + h.flash(_('An error occurred during deletion of repository user'), category='error') raise HTTPInternalServerError() @@ -237,14 +237,14 @@ class ReposController(BaseController): repo_model = RepoModel() repo_model.delete_stats(repo_name) except Exception, e: - h.flash(_('An error occured during deletion of repository stats'), + h.flash(_('An error occurred during deletion of repository stats'), category='error') return redirect(url('edit_repo', repo_name=repo_name)) @HasPermissionAllDecorator('hg.admin') def repo_cache(self, repo_name): """ - INVALIDATE exisitings repository cache + INVALIDATE existing repository cache :param repo_name: """ diff --git a/rhodecode/controllers/admin/settings.py b/rhodecode/controllers/admin/settings.py --- a/rhodecode/controllers/admin/settings.py +++ b/rhodecode/controllers/admin/settings.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- """ - package.rhodecode.controllers.admin.settings - ~~~~~~~~~~~~~~ + rhodecode.controllers.admin.settings + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + settings controller for rhodecode admin :created_on: Jul 14, 2010 diff --git a/rhodecode/controllers/admin/users.py b/rhodecode/controllers/admin/users.py --- a/rhodecode/controllers/admin/users.py +++ b/rhodecode/controllers/admin/users.py @@ -87,7 +87,7 @@ class UsersController(BaseController): encoding="UTF-8") except Exception: log.error(traceback.format_exc()) - h.flash(_('error occured during creation of user %s') \ + h.flash(_('error occurred during creation of user %s') \ % request.POST.get('username'), category='error') return redirect(url('users')) @@ -144,7 +144,7 @@ class UsersController(BaseController): except (UserOwnsReposException, DefaultUserException), e: h.flash(str(e), category='warning') except Exception: - h.flash(_('An error occured during deletion of user'), + h.flash(_('An error occurred during deletion of user'), category='error') return redirect(url('users')) diff --git a/rhodecode/controllers/error.py b/rhodecode/controllers/error.py --- a/rhodecode/controllers/error.py +++ b/rhodecode/controllers/error.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - package.rhodecode.controllers.error - ~~~~~~~~~~~~~~ + rhodecode.controllers.error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ RhodeCode error controller diff --git a/rhodecode/controllers/settings.py b/rhodecode/controllers/settings.py --- a/rhodecode/controllers/settings.py +++ b/rhodecode/controllers/settings.py @@ -50,7 +50,7 @@ class SettingsController(BaseController) c.repo_info = repo = repo_model.get_by_repo_name(repo_name) if not repo: h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the filesystem' + ' it was created or renamed from the file system' ' please run the application again' ' in order to rescan repositories') % repo_name, category='error') @@ -139,7 +139,7 @@ class SettingsController(BaseController) c.repo_info = repo = repo_model.get_by_repo_name(repo_name) if not repo: h.flash(_('%s repository is not mapped to db perhaps' - ' it was created or renamed from the filesystem' + ' it was created or renamed from the file system' ' please run the application again' ' in order to rescan repositories') % repo_name, category='error') diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - package.rhodecode.controllers.summary - ~~~~~~~~~~~~~~ + rhodecode.controllers.summary + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Summary controller for Rhodecode diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -113,6 +113,7 @@ def action_logger(user, action, repo, ip def get_repos(path, recursive=False, initial=False): """ Scans given path for repos and return (name,(type,path)) tuple + :param prefix: :param path: :param recursive: @@ -137,7 +138,7 @@ def get_repos(path, recursive=False, ini def check_repo_fast(repo_name, base_path): """ - Check given path for existance of directory + Check given path for existence of directory :param repo_name: :param base_path: @@ -233,8 +234,8 @@ def make_ui(read_from='file', path=None, def set_rhodecode_config(config): - """ - Updates pylons config with new settings from database + """Updates pylons config with new settings from database + :param config: """ from rhodecode.model.settings import SettingsModel @@ -244,10 +245,10 @@ def set_rhodecode_config(config): config[k] = v def invalidate_cache(cache_key, *args): - """ - Puts cache invalidation task into db for + """Puts cache invalidation task into db for further global cache invalidation """ + from rhodecode.model.scm import ScmModel if cache_key.startswith('get_repo_cached_'): @@ -269,10 +270,10 @@ class EmptyChangeset(BaseChangeset): @LazyProperty def raw_id(self): - """ - Returns raw string identifying this changeset, useful for web + """Returns raw string identifying this changeset, useful for web representation. """ + return self._empty_cs @LazyProperty @@ -289,8 +290,7 @@ class EmptyChangeset(BaseChangeset): return 0 def repo2db_mapper(initial_repo_list, remove_obsolete=False): - """ - maps all found repositories into db + """maps all found repositories into db """ sa = meta.Session() @@ -443,10 +443,10 @@ def add_cache(settings): beaker.cache.cache_regions[region] = region_settings def get_current_revision(): - """ - Returns tuple of (number, id) from repository containing this package + """Returns tuple of (number, id) from repository containing this package or None if repository could not be found. """ + try: from vcs import get_repo from vcs.utils.helpers import get_scm