# HG changeset patch # User Marcin Kuzminski # Date 2012-02-29 00:38:14 # Node ID f664d3b57fa493001878795df5ef126764ff29c0 # Parent de372c3a329e0b353bdb093dd50d3cf6ecf7c8e4 p2.5 fixes diff --git a/docs/changelog.rst b/docs/changelog.rst --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,6 +17,8 @@ news fixes +++++ +- fixed some python2.5 compatibility issues + 1.3.2 (**2012-02-28**) ---------------------- diff --git a/rhodecode/controllers/changeset.py b/rhodecode/controllers/changeset.py --- a/rhodecode/controllers/changeset.py +++ b/rhodecode/controllers/changeset.py @@ -53,7 +53,7 @@ log = logging.getLogger(__name__) def anchor_url(revision, path): fid = h.FID(revision, path) - return h.url.current(anchor=fid, **request.GET) + return h.url.current(anchor=fid, **dict(request.GET)) def get_ignore_ws(fid, GET): diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -28,8 +28,8 @@ import calendar import logging from time import mktime from datetime import timedelta, date -from itertools import product from urlparse import urlparse +from rhodecode.lib.compat import product from rhodecode.lib.vcs.exceptions import ChangesetError, EmptyRepositoryError, \ NodeDoesNotExistError diff --git a/rhodecode/lib/compat.py b/rhodecode/lib/compat.py --- a/rhodecode/lib/compat.py +++ b/rhodecode/lib/compat.py @@ -379,3 +379,21 @@ if __platform__ in PLATFORM_WIN: else: kill = os.kill + + +#============================================================================== +# itertools.product +#============================================================================== + +try: + from itertools import product +except ImportError: + def product(*args, **kwds): + # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy + # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111 + pools = map(tuple, args) * kwds.get('repeat', 1) + result = [[]] + for pool in pools: + result = [x + [y] for x in result for y in pool] + for prod in result: + yield tuple(prod) diff --git a/rhodecode/templates/admin/repos/repos.html b/rhodecode/templates/admin/repos/repos.html --- a/rhodecode/templates/admin/repos/repos.html +++ b/rhodecode/templates/admin/repos/repos.html @@ -42,8 +42,8 @@ - %for cnt,repo in enumerate(c.repos_list,1): - + %for cnt,repo in enumerate(c.repos_list): + ${dt.quick_menu(repo['name'])} diff --git a/rhodecode/templates/index_base.html b/rhodecode/templates/index_base.html --- a/rhodecode/templates/index_base.html +++ b/rhodecode/templates/index_base.html @@ -69,8 +69,8 @@ - %for cnt,repo in enumerate(c.repos_list,1): - + %for cnt,repo in enumerate(c.repos_list): + ##QUICK MENU ${dt.quick_menu(repo['name'])} @@ -115,7 +115,7 @@