Merged in the py3clean work, which removes usage of six and __future__ imports, along with other py2/3 compatibility code.

- Legacy-Id: 17619
This commit is contained in:
Henrik Levkowetz 2020-04-14 19:06:53 +00:00
commit 5a0a502ff9
463 changed files with 636 additions and 1604 deletions

3
PLAN
View file

@ -7,9 +7,6 @@ Updated: $Date$
Planned work in rough order
===========================
* Remove Python 2.7 compatibility code. This includes cleaning up 'from future'
imports and usages of 'six' 2/3 compatibility modules.
* Transition to Django 2.2 (via 2.0 and 2.1). This depends on Python 3.x.
Security updates to Django 1.11 will cease around April 2020.

View file

@ -33,7 +33,7 @@ COPYRIGHT
Open Source Initiative at http://opensource.org/licenses/BSD-2-Clause.
"""
from __future__ import print_function
import datetime
import os

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess

View file

@ -2,18 +2,16 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from . import checks # pyflakes:ignore
# Don't add patch number here:
__version__ = "6.126.1.dev0"
__version__ = "6.124.1.dev0"
# set this to ".p1", ".p2", etc. after patching
__patch__ = ""
__date__ = "$Date$"
__rev__ = "$Rev$ (dev) Latest release: Rev. 17612 "
__rev__ = "$Rev$ (dev) Latest release: Rev. 17582 "
__id__ = "$Id$"

View file

@ -1,14 +1,11 @@
# Copyright The IETF Trust 2014-2019, All Rights Reserved
# Copyright The IETF Trust 2014-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import re
import six
from six.moves.urllib.parse import urlencode
from urllib.parse import urlencode
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
@ -82,7 +79,7 @@ class TimedeltaField(ApiField):
if value is None:
return None
if isinstance(value, six.string_types):
if isinstance(value, str):
match = TIMEDELTA_REGEX.search(value)
if match:
@ -97,7 +94,7 @@ class TimedeltaField(ApiField):
value = super(TimedeltaField, self).hydrate(bundle)
if value and not hasattr(value, 'seconds'):
if isinstance(value, six.string_types):
if isinstance(value, str):
try:
match = TIMEDELTA_REGEX.search(value)
@ -125,7 +122,7 @@ class ToOneField(tastypie.fields.ToOneField):
if callable(self.attribute):
previous_obj = bundle.obj
foreign_obj = self.attribute(bundle)
elif isinstance(self.attribute, six.string_types):
elif isinstance(self.attribute, str):
foreign_obj = bundle.obj
for attr in self._attrs:

View file

@ -1,6 +1,6 @@
# Copyright The IETF Trust 2014-2019, All Rights Reserved
# Copyright The IETF Trust 2014-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import datetime

View file

@ -1,12 +1,9 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import hashlib
import json
import six
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist, FieldError
@ -154,7 +151,7 @@ class AdminJsonSerializer(Serializer):
if hasattr(field_value, "_meta"):
self._current[name] = self.expand_related(field_value, name)
else:
self._current[name] = six.text_type(field_value)
self._current[name] = str(field_value)
except ObjectDoesNotExist:
pass
except AttributeError:

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2015-2019, All Rights Reserved
# Copyright The IETF Trust 2015-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import sys

View file

@ -1,6 +1,6 @@
# Copyright The IETF Trust 2017-2019, All Rights Reserved
# Copyright The IETF Trust 2017-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from jwcrypto.jwk import JWK

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python
from __future__ import print_function
import os, sys
import syslog

View file

@ -2,15 +2,11 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import six
import sys
import time
from textwrap import dedent
if six.PY3:
from typing import List, Tuple # pyflakes:ignore
from typing import List, Tuple # pyflakes:ignore
import debug # pyflakes:ignore
debug.debug = True

View file

@ -1,6 +1,6 @@
# Copyright The IETF Trust 2017-2019, All Rights Reserved
# Copyright The IETF Trust 2017-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.contrib import admin

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import re
from django import forms

View file

@ -1,11 +1,9 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from __future__ import absolute_import, print_function, unicode_literals
import six
if six.PY3:
from typing import List, Tuple # pyflakes:ignore
from typing import List, Tuple # pyflakes:ignore
from django.db import migrations, models
import django.db.models.deletion

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from __future__ import absolute_import, print_function, unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 14:23
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 14:27
from __future__ import absolute_import, print_function, unicode_literals
import sys
from tqdm import tqdm

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-22 08:15
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-22 08:15
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-27 05:56
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
import sys, time

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-30 03:06
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.db.models import signals

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2016-2019, All Rights Reserved
# Copyright The IETF Trust 2016-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from pyquery import PyQuery
from django.urls import reverse as urlreverse

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2016-2019, All Rights Reserved
# Copyright The IETF Trust 2016-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import re
from django.db.models import Q

View file

@ -1,13 +1,10 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import csv
import datetime
import json
import six
import uuid
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseRedirect, Http404
@ -204,7 +201,7 @@ def export_to_csv(request, username=None, acronym=None, group_type=None):
row.append(e.time.strftime("%Y-%m-%d") if e else "")
row.append(strip_tags(doc.friendly_state()))
row.append(doc.group.acronym if doc.group else "")
row.append(six.text_type(doc.ad) if doc.ad else "")
row.append(str(doc.ad) if doc.ad else "")
e = doc.latest_event()
row.append(e.time.strftime("%Y-%m-%d") if e else "")
writer.writerow([v.encode("utf-8") for v in row])

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2010-2019, All Rights Reserved
# Copyright The IETF Trust 2010-2020, All Rights Reserved
# coding: latin-1
from __future__ import absolute_import, print_function, unicode_literals
from types import ModuleType
# These people will be sent a stack trace if there's an uncaught exception in

View file

@ -1,11 +1,9 @@
# Copyright The IETF Trust 2015-2019, All Rights Reserved
# Copyright The IETF Trust 2015-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from pyquery import PyQuery
from six.moves.http_cookies import SimpleCookie
from http.cookies import SimpleCookie
from django.urls import reverse as urlreverse

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2010-2019, All Rights Reserved
# Copyright The IETF Trust 2010-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.shortcuts import render
from django.conf import settings

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from django.template import Context

View file

@ -1,13 +1,9 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from __future__ import absolute_import, print_function, unicode_literals
import six
if six.PY3:
from typing import List, Tuple # pyflakes:ignore
from typing import List, Tuple # pyflakes:ignore
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
import django.db.models.deletion
import ietf.utils.models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-05 11:39
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
def forward(apps, schema_editor):

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-13 13:41
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
def forward(apps, schema_editor):

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-13 13:41
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
def forward(apps, schema_editor):

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
def forward(apps, schema_editor):

View file

@ -1,7 +1,7 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-19 11:47
from __future__ import unicode_literals
from django.db import migrations

View file

@ -1,7 +1,7 @@
# Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-07 09:25
from __future__ import unicode_literals
from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright The IETF Trust 2012-2019, All Rights Reserved
from __future__ import absolute_import, print_function, unicode_literals
# Copyright The IETF Trust 2012-2020, All Rights Reserved
from django.db import models
from django.core.exceptions import ValidationError

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import string
from docutils.core import publish_string

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.contrib import admin
from django.db import models
from django import forms

View file

@ -1,17 +1,14 @@
# Copyright The IETF Trust 2010-2019, All Rights Reserved
# Copyright The IETF Trust 2010-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# expiry of Internet Drafts
from __future__ import absolute_import, print_function, unicode_literals
from django.conf import settings
import datetime, os, shutil, glob, re
import six
from pathlib import Path
if six.PY3:
from typing import List, Tuple # pyflakes:ignore
from typing import List, Tuple # pyflakes:ignore
from ietf.utils import log
from ietf.utils.mail import send_mail

View file

@ -1,16 +1,13 @@
# Copyright The IETF Trust 2016-2019, All Rights Reserved
# Copyright The IETF Trust 2016-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import debug # pyflakes:ignore
import factory
import factory.fuzzy
import datetime
import six
if six.PY3:
from typing import Optional # pyflakes:ignore
from typing import Optional # pyflakes:ignore
from django.conf import settings

View file

@ -1,11 +1,8 @@
# Copyright The IETF Trust 2007-2019, All Rights Reserved
# Copyright The IETF Trust 2007-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import six
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
@ -50,7 +47,7 @@ class DocumentChangesFeed(Feed):
return item.time
def item_author_name(self, item):
return six.text_type(item.by)
return str(item.by)
def item_link(self, item):
return urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=item.doc.canonical_name())) + "#history-%s" % item.pk

View file

@ -1,11 +1,8 @@
# Copyright The IETF Trust 2014-2019, All Rights Reserved
# Copyright The IETF Trust 2014-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import json
import six
from django.utils.html import escape
from django import forms
@ -57,9 +54,9 @@ class SearchableDocumentsField(forms.CharField):
def prepare_value(self, value):
if not value:
value = ""
if isinstance(value, six.integer_types):
if isinstance(value, int):
value = str(value)
if isinstance(value, six.string_types):
if isinstance(value, str):
items = self.parse_select2_value(value)
# accept both names and pks here
names = [ i for i in items if not i.isdigit() ]
@ -83,7 +80,7 @@ class SearchableDocumentsField(forms.CharField):
"model_name": self.model.__name__.lower()
})
return ",".join(six.text_type(o.pk) for o in value)
return ",".join(str(o.pk) for o in value)
def clean(self, value):
value = super(SearchableDocumentsField, self).clean(value)

View file

@ -1,10 +1,7 @@
# Copyright The IETF Trust 2013-2019, All Rights Reserved
# Copyright The IETF Trust 2013-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import debug #pyflakes:ignore
from django import forms

View file

@ -3,10 +3,7 @@
# generation of mails
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import six
import textwrap
from django.template.loader import render_to_string
@ -288,7 +285,7 @@ def generate_publication_request(request, doc):
approving_body = "IRSG"
consensus_body = doc.group.acronym.upper()
else:
approving_body = six.text_type(doc.stream)
approving_body = str(doc.stream)
consensus_body = approving_body
e = doc.latest_event(WriteupDocEvent, type="changed_rfc_editor_note_text")

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
from collections import Counter

View file

@ -1,7 +1,6 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import io

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import django.core.validators
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-01 12:31
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-03 11:50
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
def forward(apps, schema_editor):

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-03 12:16
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
def forward(apps, schema_editor):

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-03 06:39
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-04 10:56
from __future__ import absolute_import, print_function, unicode_literals
from tqdm import tqdm
from django.db import migrations

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-28 13:11
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-28 13:33
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations
from django.db.models import F

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-02-25 13:02
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-11 11:22
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-01 04:43
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 08:41
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 08:42
from __future__ import absolute_import, print_function, unicode_literals
import sys
from tqdm import tqdm

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 10:29
from __future__ import absolute_import, print_function, unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-28 12:42
from __future__ import absolute_import, print_function, unicode_literals
import sys, time
from django.db import migrations, models

View file

@ -1,11 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 14:04
from __future__ import absolute_import, print_function, unicode_literals
import six
import sys
from tqdm import tqdm
@ -18,7 +15,7 @@ def forward(apps, schema_editor):
n = getattr(o, a+'_id')
if n:
i = nameid[n]
if not isinstance(i, six.integer_types):
if not isinstance(i, int):
raise ValueError("Inappropriate value: %s: nameid[%s]: %s" % (o.__class__.__name__, n, i))
if getattr(o, a+'2_id') != i:
setattr(o, a+'2_id', i)

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-09 05:46
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-20 09:53
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 05:31
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 05:31
from __future__ import absolute_import, print_function, unicode_literals
import sys, time
from django.db import migrations

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-30 03:36
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-06-10 03:47
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models

View file

@ -1,10 +1,8 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-06-10 04:36
from __future__ import absolute_import, print_function, unicode_literals
import sys
from tqdm import tqdm

View file

@ -1,7 +1,7 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-07 12:07
from __future__ import unicode_literals
from django.db import migrations

View file

@ -1,7 +1,7 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-07 12:27
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion

View file

@ -1,7 +1,6 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations

View file

@ -1,7 +1,7 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-08-03 10:09
from __future__ import unicode_literals
from django.db import migrations

View file

@ -1,7 +1,7 @@
# Copyright The IETF Trust 2019, All Rights Reserved
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-10 10:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion

View file

@ -1,7 +1,7 @@
# Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-17 11:54
from __future__ import unicode_literals
from django.db import migrations, models

View file

@ -1,13 +1,12 @@
# Copyright The IETF Trust 2010-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import logging
import io
import os
import rfc2html
import six
from django.db import models
from django.core import checks
@ -418,7 +417,7 @@ class DocumentInfo(models.Model):
def relations_that(self, relationship):
"""Return the related-document objects that describe a given relationship targeting self."""
if isinstance(relationship, six.string_types):
if isinstance(relationship, str):
relationship = ( relationship, )
if not isinstance(relationship, tuple):
raise TypeError("Expected a string or tuple, received %s" % type(relationship))
@ -441,7 +440,7 @@ class DocumentInfo(models.Model):
def relations_that_doc(self, relationship):
"""Return the related-document objects that describe a given relationship from self to other documents."""
if isinstance(relationship, six.string_types):
if isinstance(relationship, str):
relationship = ( relationship, )
if not isinstance(relationship, tuple):
raise TypeError("Expected a string or tuple, received %s" % type(relationship))

View file

@ -2,12 +2,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import bleach
import datetime
import re
import six
from email.utils import parseaddr
@ -23,11 +20,12 @@ from django.urls import reverse as urlreverse
import debug # pyflakes:ignore
from ietf.doc.models import BallotDocEvent
from ietf.doc.models import ConsensusDocEvent
from ietf.utils.html import sanitize_fragment
from ietf.utils import log
from ietf.doc.utils import prettify_std_name
from ietf.utils.text import wordwrap, fill, wrap_text_if_unwrapped
from ietf.utils.html import sanitize_fragment
from ietf.doc.models import BallotDocEvent
register = template.Library()
@ -72,7 +70,7 @@ def parse_email_list(value):
"""
if value and isinstance(value, (six.binary_type, six.text_type)): # testing for 'value' being true isn't necessary; it's a fast-out route
if value and isinstance(value, str): # testing for 'value' being true isn't necessary; it's a fast-out route
addrs = re.split(", ?", value)
ret = []
for addr in addrs:
@ -81,6 +79,8 @@ def parse_email_list(value):
name = email
ret.append('<a href="mailto:%s">%s</a>' % ( email.replace('&', '&amp;'), escape(name) ))
return mark_safe(", ".join(ret))
elif value and isinstance(value, bytes):
log.assertion('isinstance(value, str)')
else:
return value
@ -117,8 +117,10 @@ def make_one_per_line(value):
>>> make_one_per_line(None)
"""
if value and isinstance(value, (six.binary_type, six.text_type)):
if value and isinstance(value, str):
return re.sub(", ?", "\n", value)
elif value and isinstance(value, bytes):
log.assertion('isinstance(value, str)')
else:
return value
@ -153,10 +155,12 @@ def sanitize(value):
@register.filter(name='bracket')
def square_brackets(value):
"""Adds square brackets around text."""
if isinstance(value, (six.binary_type, six.text_type)):
if isinstance(value, str):
if value == "":
value = " "
return "[ %s ]" % value
elif isinstance(value, bytes):
log.assertion('isinstance(value, str)')
elif value > 0:
return "[ X ]"
elif value < 0:
@ -364,7 +368,7 @@ def expires_soon(x,request):
@register.filter(name='startswith')
def startswith(x, y):
return six.text_type(x).startswith(y)
return str(x).startswith(y)
@register.filter
def has_role(user, role_names):

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2016-2019, All Rights Reserved
# Copyright The IETF Trust 2016-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django import template
import debug # pyflakes:ignore

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import datetime
@ -17,9 +15,9 @@ if sys.version_info[0] == 2 and sys.version_info[1] < 7:
else:
import unittest
from six.moves.http_cookies import SimpleCookie
from http.cookies import SimpleCookie
from pyquery import PyQuery
from six.moves.urllib.parse import urlparse, parse_qs
from urllib.parse import urlparse, parse_qs
from tempfile import NamedTemporaryFile
from django.urls import reverse as urlreverse

View file

@ -2,8 +2,6 @@
# Copyright The IETF Trust 2011-2020, All Rights Reserved
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import io
import os

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import io
import os
import shutil

View file

@ -1,10 +1,7 @@
# Copyright The IETF Trust 2017-2019, All Rights Reserved
# Copyright The IETF Trust 2017-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.urls import reverse as urlreverse
from pyquery import PyQuery

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import datetime

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2014-2019, All Rights Reserved
# Copyright The IETF Trust 2014-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import shutil
import datetime

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2016-2019, All Rights Reserved
# Copyright The IETF Trust 2016-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime, os, shutil
import io
import tarfile, tempfile, mailbox

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2013-2019, All Rights Reserved
# Copyright The IETF Trust 2013-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import io
import os
import shutil

View file

@ -1,4 +1,4 @@
# Copyright The IETF Trust 2009-2019, All Rights Reserved
# Copyright The IETF Trust 2009-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
@ -33,8 +33,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import absolute_import, print_function, unicode_literals
from django.conf.urls import include
from django.views.generic import RedirectView
from django.conf import settings

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ietf.doc import views_conflict_review, views_doc
from ietf.utils.urls import url

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import hashlib
import io
@ -11,10 +9,9 @@ import json
import math
import os
import re
import six
from collections import defaultdict
from six.moves.urllib.parse import quote
from urllib.parse import quote
from django.conf import settings
from django.contrib import messages
@ -705,7 +702,7 @@ def get_initial_notify(doc,extra=None):
receivers = []
if extra:
if isinstance(extra, six.string_types):
if isinstance(extra, str):
extra = extra.split(', ')
receivers.extend(extra)

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import io
import os

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import debug # pyflakes:ignore

View file

@ -4,8 +4,6 @@
# Directors and Secretariat
from __future__ import absolute_import, print_function, unicode_literals
import datetime, json
from django import forms

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import io
import json

View file

@ -1,9 +1,7 @@
# Copyright The IETF Trust 2012-2019, All Rights Reserved
# Copyright The IETF Trust 2012-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import io
import os

View file

@ -34,17 +34,14 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import glob
import io
import json
import os
import re
import six
from six.moves.urllib.parse import quote
from urllib.parse import quote
from django.http import HttpResponse, Http404 , HttpResponseForbidden
from django.shortcuts import render, get_object_or_404, redirect
@ -1392,7 +1389,7 @@ def add_sessionpresentation(request,name):
if doc.group:
sessions = sorted(sessions,key=lambda x:0 if x.group==doc.group else 1)
session_choices = [(s.pk, six.text_type(s)) for s in sessions]
session_choices = [(s.pk, str(s)) for s in sessions]
if request.method == 'POST':
version_form = VersionForm(request.POST,choices=version_choices)

View file

@ -1,10 +1,7 @@
# Copyright The IETF Trust 2017-2019, All Rights Reserved
# Copyright The IETF Trust 2017-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.urls import reverse as urlreverse
from django.http import HttpResponseRedirect
from django.shortcuts import render

View file

@ -2,8 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
# changing state and metadata on Internet Drafts
import datetime

Some files were not shown because too many files have changed in this diff Show more