Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/django-baker/files: django-baker-0.11-py3-backport.patch
Date: Sun, 01 Mar 2015 17:33:06
Message-Id: 20150301173303.A87C412D15@oystercatcher.gentoo.org
1 jlec 15/03/01 17:33:03
2
3 Added: django-baker-0.11-py3-backport.patch
4 Log:
5 Fix py3 support
6
7 (Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
8
9 Revision Changes Path
10 1.1 dev-python/django-baker/files/django-baker-0.11-py3-backport.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/django-baker/files/django-baker-0.11-py3-backport.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/django-baker/files/django-baker-0.11-py3-backport.patch?rev=1.1&content-type=text/plain
14
15 Index: django-baker-0.11-py3-backport.patch
16 ===================================================================
17 From baf971a58d310d6d3bfe7ddea81b33c810e3d3cf Mon Sep 17 00:00:00 2001
18 From: Tim Kamanin <tim@××××××××.com>
19 Date: Sat, 21 Feb 2015 18:42:45 +0100
20 Subject: [PATCH] Added Python 3 support
21
22 ---
23 django_baker/bakery.py | 4 ++--
24 django_baker/management/commands/bake.py | 3 ++-
25 2 files changed, 4 insertions(+), 3 deletions(-)
26
27 diff --git a/django_baker/bakery.py b/django_baker/bakery.py
28 index ff04ef3..7c0cbc2 100644
29 --- a/django_baker/bakery.py
30 +++ b/django_baker/bakery.py
31 @@ -4,7 +4,7 @@
32 import re
33 from django.template.loader import get_template
34 from django.template import Context
35 -
36 +from django.utils.six import iteritems
37
38 class Baker(object):
39 """
40 @@ -16,7 +16,7 @@ def bake(self, apps_and_models):
41 """
42 Iterates a dictionary of apps and models and creates all the necessary files to get up and running quickly.
43 """
44 - for app_label, models in apps_and_models.iteritems():
45 + for app_label, models in iteritems(apps_and_models):
46 model_names = {model.__name__: self.get_field_names_for_model(model) for model in models}
47 self.create_directories(app_label)
48 self.create_init_files(app_label, model_names.keys(), models)
49 diff --git a/django_baker/management/commands/bake.py b/django_baker/management/commands/bake.py
50 index e602345..f7dc16a 100644
51 --- a/django_baker/management/commands/bake.py
52 +++ b/django_baker/management/commands/bake.py
53 @@ -1,3 +1,4 @@
54 +from __future__ import print_function
55 from django.core.management.base import BaseCommand, CommandError
56 from django.core.exceptions import ImproperlyConfigured
57 from django.db.models import get_app, get_models
58 @@ -51,7 +52,7 @@ def get_selected_models(self, app, app_label, model_names):
59 """
60 if model_names:
61 try:
62 - print app_label, model_names
63 + print(app_label, model_names)
64 return [get_model(app_label, model_name) for model_name in model_names]
65 except:
66 raise CommandError("One or more of the models you entered for %s are incorrect." % app_label)