Commit ff7f716d authored by Stephen Finucane's avatar Stephen Finucane Committed by Damien Lespiau
Browse files

py3: Add required 'future' imports



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: default avatarStephen Finucane <stephen.finucane@intel.com>
Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
parent 61ffa97d
......@@ -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 (
......
......@@ -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
......
......@@ -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))
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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.safestring import mark_safe
from django.template.defaultfilters import stringfilter
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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, User, \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment