changeset 1507:7d687ed11929 beta

changed check_... functions from their stupid names to something less retarded :)
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 01 Oct 2011 21:51:28 +0300
parents 7865043e4ca9
children 4aba7be311e8
files rhodecode/config/routing.py rhodecode/lib/middleware/simplegit.py rhodecode/lib/middleware/simplehg.py rhodecode/lib/utils.py rhodecode/model/repo.py
diffstat 5 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/config/routing.py	Sat Oct 01 21:40:34 2011 +0300
+++ b/rhodecode/config/routing.py	Sat Oct 01 21:51:28 2011 +0300
@@ -20,8 +20,8 @@
     rmap.minimization = False
     rmap.explicit = False
     
-    from rhodecode.lib.utils import check_repo_fast
-    from rhodecode.lib.utils import check_repos_group_fast
+    from rhodecode.lib.utils import is_valid_repo
+    from rhodecode.lib.utils import is_valid_repos_group
     
     def check_repo(environ, match_dict):
         """
@@ -32,7 +32,7 @@
         """
          
         repo_name = match_dict.get('repo_name')
-        return check_repo_fast(repo_name, config['base_path'])
+        return is_valid_repo(repo_name, config['base_path'])
 
     def check_group(environ, match_dict):
         """
@@ -43,7 +43,7 @@
         """
         repos_group_name = match_dict.get('group_name')
         
-        return check_repos_group_fast(repos_group_name, config['base_path'])
+        return is_valid_repos_group(repos_group_name, config['base_path'])
 
 
     def check_int(environ, match_dict):
--- a/rhodecode/lib/middleware/simplegit.py	Sat Oct 01 21:40:34 2011 +0300
+++ b/rhodecode/lib/middleware/simplegit.py	Sat Oct 01 21:51:28 2011 +0300
@@ -71,7 +71,7 @@
 
 from rhodecode.lib import safe_str
 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
-from rhodecode.lib.utils import invalidate_cache, check_repo_fast
+from rhodecode.lib.utils import invalidate_cache, is_valid_repo
 from rhodecode.model.db import User
 
 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
@@ -192,7 +192,7 @@
         log.debug('Repository path is %s' % repo_path)
 
         # quick check if that dir exists...
-        if check_repo_fast(repo_name, self.basepath) is False:
+        if is_valid_repo(repo_name, self.basepath) is False:
             return HTTPNotFound()(environ, start_response)
 
         try:
--- a/rhodecode/lib/middleware/simplehg.py	Sat Oct 01 21:40:34 2011 +0300
+++ b/rhodecode/lib/middleware/simplehg.py	Sat Oct 01 21:51:28 2011 +0300
@@ -37,7 +37,7 @@
 from rhodecode.lib import safe_str
 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
 from rhodecode.lib.utils import make_ui, invalidate_cache, \
-    check_repo_fast, ui_sections
+    is_valid_repo, ui_sections
 from rhodecode.model.db import User
 
 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
@@ -161,7 +161,7 @@
         
 
         # quick check if that dir exists...
-        if check_repo_fast(repo_name, self.basepath) is False:
+        if is_valid_repo(repo_name, self.basepath) is False:
             return HTTPNotFound()(environ, start_response)
 
         try:
--- a/rhodecode/lib/utils.py	Sat Oct 01 21:40:34 2011 +0300
+++ b/rhodecode/lib/utils.py	Sat Oct 01 21:51:28 2011 +0300
@@ -180,7 +180,7 @@
     return _get_repos(path)
 
 
-def check_repo_fast(repo_name, base_path):
+def is_valid_repo(repo_name, base_path):
     """
     Returns True if given path is a valid repository False otherwise
     :param repo_name:
@@ -196,7 +196,7 @@
     except VCSError:
         return False
 
-def check_repos_group_fast(repos_group_name, base_path):
+def is_valid_repos_group(repos_group_name, base_path):
     """
     Returns True if given path is a repos group False otherwise
     
@@ -206,7 +206,7 @@
     full_path = os.path.join(base_path, repos_group_name)
     
     # check if it's not a repo
-    if check_repo_fast(repos_group_name, base_path):
+    if is_valid_repo(repos_group_name, base_path):
         return False
     
     # check if it's a valid path
--- a/rhodecode/model/repo.py	Sat Oct 01 21:40:34 2011 +0300
+++ b/rhodecode/model/repo.py	Sat Oct 01 21:51:28 2011 +0300
@@ -301,7 +301,7 @@
         :param parent_id:
         :param clone_uri:
         """
-        from rhodecode.lib.utils import check_repo_fast
+        from rhodecode.lib.utils import is_valid_repo
         
         if new_parent_id:
             paths = Group.get(new_parent_id).full_path.split(Group.url_sep())
@@ -312,7 +312,7 @@
         repo_path = os.path.join(*map(lambda x:safe_str(x),
                                 [self.repos_path, new_parent_path, repo_name]))
 
-        if check_repo_fast(repo_path, self.repos_path) is False:
+        if is_valid_repo(repo_path, self.repos_path) is False:
             log.info('creating repo %s in %s @ %s', repo_name, repo_path,
                      clone_uri)
             backend = get_backend(alias)