]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
py3: Add required 'future' imports
authorStephen Finucane <stephen.finucane@intel.com>
Thu, 26 Nov 2015 18:24:59 +0000 (18:24 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Thu, 3 Dec 2015 22:08:53 +0000 (22:08 +0000)
These are quite limited as patchwork only supports Python 2.6+. As
such, only the 'print_function' and 'absolute_import' statements are
required.

Found using 'modernize'

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
27 files changed:
patchwork/admin.py
patchwork/bin/parsearchive.py
patchwork/bin/parsemail.py
patchwork/bin/update-patchwork-status.py
patchwork/filters.py
patchwork/forms.py
patchwork/paginator.py
patchwork/parser.py
patchwork/requestcontext.py
patchwork/settings/dev.py
patchwork/settings/production.example.py
patchwork/templatetags/listurl.py
patchwork/templatetags/patch.py
patchwork/templatetags/person.py
patchwork/templatetags/syntax.py
patchwork/tests/test_bundles.py
patchwork/tests/test_list.py
patchwork/tests/test_person.py
patchwork/utils.py
patchwork/views/__init__.py
patchwork/views/base.py
patchwork/views/bundle.py
patchwork/views/mail.py
patchwork/views/patch.py
patchwork/views/project.py
patchwork/views/user.py
patchwork/views/xmlrpc.py

index d32edbabe28dd85459381fbf414e9585bcd947c1..4723a4ba44cd050c71892bb8095213f3d5035f83 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from django.contrib import admin
 
 from patchwork.models import (
index 94d898a9001c14f792f1b17be1cbfe7400547de3..5ded8ef8500d9d59e37c4a6f2cd07548c5b2ee9f 100755 (executable)
 
 """Utility to parse an mbox archive file."""
 
+from __future__ import absolute_import
+
 import argparse
 import logging
 import mailbox
 
 import django
 
-import parsemail
+from . import parsemail
 
 VERBOSITY_LEVELS = {
     'debug': logging.DEBUG,
index 513daef0c73d82d04762dcf1eac86577da1a170d..866743f9224dcc0da02ab6dadeb2f910ddff1088 100755 (executable)
@@ -19,6 +19,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 import argparse
 import codecs
 import datetime
index 2da5d23e839193294a3072b531b180bcfe269657..44f0d0a3d15f903628482f028d2567fb4bda6e31 100755 (executable)
@@ -19,6 +19,7 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import print_function
 
 import sys
 import subprocess
@@ -60,11 +61,10 @@ def main(args):
     revs = commits(options, revspec)
 
     for rev in revs:
-        print rev
-        print commit(options, rev)
+        print(rev)
+        print(commit(options, rev))
 
 
 if __name__ == '__main__':
     sys.exit(main(sys.argv))
 
-
index db671ffcbd6f02e63c71cafd4f1928a8d27e6d82..bb752fb85e0b90f5b72ac0e8c41268742f164d33 100644 (file)
@@ -18,6 +18,8 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 
+from __future__ import absolute_import
+
 from patchwork.models import Person, State
 from django.utils.safestring import mark_safe
 from django.utils.html import escape
index 03279588a1ef40d045bb02982a49dbed17d6c24e..b2d12366b764365294d0774cea688b216a47d135 100644 (file)
@@ -17,6 +17,7 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
 
 from django.contrib.auth.models import User
 from django import forms
index 286372f9e21faf5f3d8fd9ed3eb9ce2724bdc829..a409e89edd3ae9c83718752c2c4f765d9c497700 100644 (file)
@@ -17,6 +17,7 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
 
 from django.core import paginator
 from django.conf import settings
index 13b4466a4b145cfc667018ad804e9a68299c00c4..a63efed4895ad8ac5e88aef89233215331f84423 100644 (file)
@@ -19,6 +19,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+from __future__ import print_function
 
 import hashlib
 import re
@@ -257,13 +259,13 @@ def main(args):
     (patch, comment) = parse_patch(content)
 
     if options.print_hash and patch:
-        print hash_patch(patch).hexdigest()
+        print(hash_patch(patch).hexdigest())
 
     if options.print_patch and patch:
-        print "Patch: ------\n" + patch
+        print("Patch: ------\n" + patch)
 
     if options.print_comment and comment:
-        print "Comment: ----\n" + comment
+        print("Comment: ----\n" + comment)
 
 if __name__ == '__main__':
     import sys
index 8ad604955a6df7473900cb720006827739017a85..413af4d94207712db39309031b5764e797dade9d 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from django.template import RequestContext
 from django.utils.html import escape
 from django.contrib.sites.models import Site
index b4c0e589d03f978082967494aff8f82b526d89f3..c70d893e8c803bc7cdc21af718c91493cc953e4a 100644 (file)
@@ -7,9 +7,11 @@ Design based on:
     http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/
 """
 
+from __future__ import absolute_import
+
 import django
 
-from base import *
+from .base import *
 
 #
 # Core settings
index 9cf6712ec1a19d6ef0cdb2a837610c49a8cfdd1c..6aaa4da9c90bfe225dc436aee384e0c8b91e5668 100644 (file)
@@ -7,7 +7,9 @@ Design based on:
     http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/
 """
 
-from base import *
+from __future__ import absolute_import
+
+from .base import *
 
 #
 # Core settings
index a52f4fdb617f5a00d2854d86a7f5fac92223f69f..9e6e9f111dd0e274c286b5018d8942f89ff30052 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from django import template
 from django.utils.html import escape
 from django.utils.encoding import smart_str
index af5e54dda563eeea0f0e45370d40578f8387b888..79cc92333cca37427dfb422042bcaf47f3adf1b9 100644 (file)
@@ -18,6 +18,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from django import template
 from django.utils.safestring import mark_safe
 
index c337c7442de72eefa2cb3238e26be3960471d0cd..b57568921790f765943337e21e04c5338b10ee4e 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from django import template
 from django.utils.html import escape
 from django.utils.safestring import mark_safe
index abdbb4dcf72de3ab88d8f3289548b8b43deb2899..bf90b87aa53691c5ae35bc54f44f6cec2d94ba27 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from django import template
 from django.utils.html import escape
 from django.utils.safestring import mark_safe
index a9ee8dd5786353cc0c7c76c1acb360eb63a98c17..2a877d07f932fe5881fe1979a557924ae830decf 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 import unittest
 import datetime
 from django.test import TestCase
index f440e3ee0b7f9e803a5a21ced92341bbc588c95d..44cfc92059ce5202a6fda8706357987b206a68ec 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 import unittest
 import random
 import datetime
index 5ce871364d88e39b5eea4a102ed394f8bc6c5783..ddbbb7cb55374d524087b679d76be1e2af31d25a 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 import unittest
 from django.test import TestCase
 from django.test.client import Client
index d69cb210ace4fa715adc5305d7fb2d38acc59ed7..62ae00f5e2cc3315fe3ea6dc34e3207675fa9eab 100644 (file)
@@ -17,6 +17,7 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
 
 import itertools
 import datetime
index ffae91a15132a0993cf4d5f20a31998b4b2c9bb8..b0b4e885e8530e71387980e811dff38cbaf16843 100644 (file)
@@ -17,8 +17,9 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
 
-from base import *
+from .base import *
 from patchwork.utils import Order, get_patch_ids, bundle_actions, set_bundle
 from patchwork.paginator import Paginator
 from patchwork.forms import MultiplePatchForm
index 9d90f5667f6c88c60e9d92281a244dcc2adf4839..9f210125ed4b633bd586fa91e60cf4ef0ac3acae 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 import json
 
 from patchwork.models import Patch, Project, Person, EmailConfirmation
index 3fb47e2fa5a91848e7b7eb95cb6d11076db9e78c..48d7c67e3c1c91ca7bf607693471344bdffaee10 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from django.contrib.auth.decorators import login_required
 from django.contrib.auth.models import User
 from django.shortcuts import render_to_response, get_object_or_404
index aebba34cddd899367d41db79f745784e7744783c..46c8768305c6be9c6ef671b788fce16ad0dddf53 100644 (file)
@@ -17,6 +17,8 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
+
 from patchwork.requestcontext import PatchworkRequestContext
 from patchwork.models import EmailOptout, EmailConfirmation
 from patchwork.forms import OptinoutRequestForm, EmailForm
index 62ff8531b02967d83094b8732586c1acdbb31b38..30aeef2c4c9380670743e589778bcb556822359a 100644 (file)
@@ -17,6 +17,7 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
 
 from patchwork.models import Patch, Project, Bundle
 from patchwork.forms import PatchForm, CreateBundleForm
index 114dbe07dae7f9828c70564eb4794b3e92c3ee71..024799ebc066463d09b87fff64bd17552d7e3524 100644 (file)
@@ -17,6 +17,7 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
 
 from patchwork.models import Patch, Project
 from django.shortcuts import render_to_response, get_object_or_404
index 126ecc95c4ca27444aff1721271baf648fd0a0a3..97d15a7ea486d405b47fabdad989c5656159d8bb 100644 (file)
@@ -17,6 +17,7 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+from __future__ import absolute_import
 
 from django.contrib.auth.decorators import login_required
 from patchwork.requestcontext import PatchworkRequestContext
index 6bdfe5674b1de3fdc7fed2735177e0c2eb4b47eb..3b0be9fae052656c34681ef993023a943db2ba57 100644 (file)
@@ -20,6 +20,8 @@
 # Patchwork XMLRPC interface
 #
 
+from __future__ import absolute_import
+
 from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
 from DocXMLRPCServer import XMLRPCDocGenerator
 import base64