Remove use of six
Review Request #11939 — Created Jan. 19, 2022 and submitted — Latest diff uploaded
This change removes the remainder of the uses of the
six
library from
Djblets.
In conjunction with other changes, ran unit tests.
Diff Revision 1
This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.
orig
1
2
Commits
Files
djblets/siteconfig/management/commands/set-siteconfig.py | |||
---|---|---|---|
Revision acd8d6a625211bf905ba69763b8bb2cf227e7122 | New Change | ||
1 |
from __future__ import unicode_literals |
1 |
from __future__ import unicode_literals |
2 | 2 | ||
3 |
from django.core.management.base import BaseCommand, CommandError |
3 |
from django.core.management.base import BaseCommand, CommandError |
4 |
from django.utils import six |
||
5 |
from django.utils.translation import ugettext as _ |
4 |
from django.utils.translation import ugettext as _ |
6 | 5 | ||
7 |
from djblets.siteconfig.models import SiteConfiguration |
6 |
from djblets.siteconfig.models import SiteConfiguration |
8 | 7 | ||
9 | 8 | ||
54 lines | |||
def handle(self, *args, **options):
|
|||
64 |
raise CommandError(_("'%s' is not a valid settings key") % key) |
63 |
raise CommandError(_("'%s' is not a valid settings key") % key) |
65 | 64 | ||
66 |
stored_value = node[key_basename] |
65 |
stored_value = node[key_basename] |
67 |
value_type = type(stored_value) |
66 |
value_type = type(stored_value) |
68 | 67 | ||
69 |
if value_type not in (six.text_type, six.binary_type, int, bool, |
68 |
if value_type not in (str, bytes, int, bool, type(None)): |
70 |
type(None)): |
||
71 |
raise CommandError(_("Cannot set %s keys") % value_type.__name__) |
69 |
raise CommandError(_("Cannot set %s keys") % value_type.__name__) |
72 | 70 | ||
73 |
try: |
71 |
try: |
74 |
if value_type is bool: |
72 |
if value_type is bool: |
75 |
if value not in ('1', '0', 'True', 'true', 'False', 'false'): |
73 |
if value not in ('1', '0', 'True', 'true', 'False', 'false'): |
30 lines |
djblets/testing/decorators.py |
---|
djblets/testing/testcases.py |
---|
djblets/urls/staticfiles.py |
---|
djblets/util/dates.py |
---|
djblets/util/html.py |
---|
djblets/util/http.py |
---|
djblets/util/json_utils.py |
---|
djblets/util/properties.py |
---|
djblets/util/compat/django/core/management/base.py |
---|
djblets/util/compat/django/utils/functional.py |
---|
djblets/util/compat/python/past.py |
---|
djblets/util/templatetags/djblets_images.py |
---|
djblets/util/templatetags/djblets_js.py |
---|
djblets/util/templatetags/djblets_utils.py |
---|
djblets/util/tests/test_djblets_utils_tags.py |
---|
djblets/util/tests/test_json_utils.py |
---|
djblets/util/tests/test_properties.py |
---|
djblets/webapi/decorators.py |
---|
djblets/webapi/encoders.py |
---|