From 3e88b66cfae7630d0dc7f647d9747113d6fe37bb Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Sun, 29 Apr 2018 12:00:00 +0200 Subject: [PATCH] Removed unicode literals --- client/js/dpaste.js | 9 ++++----- dpaste/apps.py | 2 -- dpaste/forms.py | 2 -- dpaste/highlight.py | 2 -- dpaste/migrations/0001_initial.py | 1 - dpaste/migrations/0002_auto_20170119_1038.py | 1 - dpaste/migrations/0003_snippet_highlighted.py | 1 - dpaste/migrations/0004_auto_20180107_1603.py | 1 - dpaste/models.py | 2 -- dpaste/settings/base.py | 1 - dpaste/templatetags/dpaste_tags.py | 2 -- dpaste/tests/test_api.py | 1 - dpaste/tests/test_highlight.py | 3 +-- dpaste/tests/test_snippet.py | 1 - dpaste/urls/dpaste.py | 2 -- dpaste/urls/dpaste_api.py | 2 -- dpaste/views.py | 2 -- runtests.py | 2 +- 18 files changed, 6 insertions(+), 31 deletions(-) diff --git a/client/js/dpaste.js b/client/js/dpaste.js index 43942a9..5c656ea 100644 --- a/client/js/dpaste.js +++ b/client/js/dpaste.js @@ -3,13 +3,13 @@ // ----------------------------------------------------------------------------- // Add data-platform to the body tag to show platform related shortcuts // ----------------------------------------------------------------------------- -const isWindows = navigator.appVersion.indexOf("Win") !== -1; +const isWindows = navigator.appVersion.indexOf('Win') !== -1; document.body.dataset.platform = isWindows ? 'win' : 'mac'; // ----------------------------------------------------------------------------- // Autofocus the content field on the homepage // ----------------------------------------------------------------------------- -const af = document.querySelector(".autofocus textarea"); +const af = document.querySelector('.autofocus textarea'); if (af !== null) { af.focus(); } @@ -19,7 +19,7 @@ if (af !== null) { // ----------------------------------------------------------------------------- document.body.onkeydown = function(e) { const metaKey = isWindows ? e.ctrlKey : e.metaKey; - const form = document.querySelector(".snippet-form"); + const form = document.querySelector('.snippet-form'); if (form && e.keyCode === 13 && metaKey) { form.submit(); @@ -27,7 +27,6 @@ document.body.onkeydown = function(e) { } }; - // ----------------------------------------------------------------------------- // Toggle Wordwrap // ----------------------------------------------------------------------------- @@ -89,6 +88,6 @@ if (clipboardLink && copyToClipboardField) { clipboardLink.onclick = function(e) { e.preventDefault(); copyToClipboardField.select(); - document.execCommand("Copy"); + document.execCommand('Copy'); }; } diff --git a/dpaste/apps.py b/dpaste/apps.py index 6b95ca5..f1f0676 100644 --- a/dpaste/apps.py +++ b/dpaste/apps.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.apps import AppConfig diff --git a/dpaste/forms.py b/dpaste/forms.py index 4a681e5..4230705 100644 --- a/dpaste/forms.py +++ b/dpaste/forms.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import datetime from django import forms diff --git a/dpaste/highlight.py b/dpaste/highlight.py index 00c2255..08c555c 100644 --- a/dpaste/highlight.py +++ b/dpaste/highlight.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from logging import getLogger from django.conf import settings diff --git a/dpaste/migrations/0001_initial.py b/dpaste/migrations/0001_initial.py index 5640c22..f4b9e20 100644 --- a/dpaste/migrations/0001_initial.py +++ b/dpaste/migrations/0001_initial.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals from django.db import models, migrations diff --git a/dpaste/migrations/0002_auto_20170119_1038.py b/dpaste/migrations/0002_auto_20170119_1038.py index aced2eb..89aa8d9 100644 --- a/dpaste/migrations/0002_auto_20170119_1038.py +++ b/dpaste/migrations/0002_auto_20170119_1038.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-19 10:38 -from __future__ import unicode_literals from django.db import migrations diff --git a/dpaste/migrations/0003_snippet_highlighted.py b/dpaste/migrations/0003_snippet_highlighted.py index 79597ce..65ffcbc 100644 --- a/dpaste/migrations/0003_snippet_highlighted.py +++ b/dpaste/migrations/0003_snippet_highlighted.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11a1 on 2017-01-21 16:04 -from __future__ import unicode_literals from django.db import migrations, models diff --git a/dpaste/migrations/0004_auto_20180107_1603.py b/dpaste/migrations/0004_auto_20180107_1603.py index 2b8e92e..2a03bde 100644 --- a/dpaste/migrations/0004_auto_20180107_1603.py +++ b/dpaste/migrations/0004_auto_20180107_1603.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-01-07 16:03 -from __future__ import unicode_literals from django.db import migrations, models diff --git a/dpaste/models.py b/dpaste/models.py index 28b6e75..1888540 100644 --- a/dpaste/models.py +++ b/dpaste/models.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from random import SystemRandom from django.conf import settings diff --git a/dpaste/settings/base.py b/dpaste/settings/base.py index c6082b9..2017f90 100644 --- a/dpaste/settings/base.py +++ b/dpaste/settings/base.py @@ -1,7 +1,6 @@ # Import global settings to make it easier to extend settings. from django.conf.global_settings import * - #============================================================================== # Calculation of directories relative to the module location #============================================================================== diff --git a/dpaste/templatetags/dpaste_tags.py b/dpaste/templatetags/dpaste_tags.py index baabc17..49a407c 100644 --- a/dpaste/templatetags/dpaste_tags.py +++ b/dpaste/templatetags/dpaste_tags.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import os from logging import getLogger diff --git a/dpaste/tests/test_api.py b/dpaste/tests/test_api.py index c829405..91f1598 100644 --- a/dpaste/tests/test_api.py +++ b/dpaste/tests/test_api.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -from __future__ import unicode_literals from django.urls import reverse from django.test import TestCase diff --git a/dpaste/tests/test_highlight.py b/dpaste/tests/test_highlight.py index a55f43c..d6879c8 100644 --- a/dpaste/tests/test_highlight.py +++ b/dpaste/tests/test_highlight.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -from __future__ import unicode_literals from textwrap import dedent @@ -89,7 +88,7 @@ class HighlightAPITestCase(TestCase): input = dedent(""" ========================= Generate 15 random numbers - 70 180 3 179 192 117 75 72 90 190 49 159 63 14 55 + 70 180 3 179 192 117 75 72 90 190 49 159 63 14 55 ========================= """) try: diff --git a/dpaste/tests/test_snippet.py b/dpaste/tests/test_snippet.py index 8c1f1be..d86e989 100644 --- a/dpaste/tests/test_snippet.py +++ b/dpaste/tests/test_snippet.py @@ -1,5 +1,4 @@ # -*- encoding: utf-8 -*- -from __future__ import unicode_literals from datetime import timedelta diff --git a/dpaste/urls/dpaste.py b/dpaste/urls/dpaste.py index 38df9dc..76d7281 100644 --- a/dpaste/urls/dpaste.py +++ b/dpaste/urls/dpaste.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf import settings from django.conf.urls import url diff --git a/dpaste/urls/dpaste_api.py b/dpaste/urls/dpaste_api.py index 91c125a..6bd6990 100644 --- a/dpaste/urls/dpaste_api.py +++ b/dpaste/urls/dpaste_api.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import url from django.views.decorators.csrf import csrf_exempt diff --git a/dpaste/views.py b/dpaste/views.py index 077126a..b8af852 100644 --- a/dpaste/views.py +++ b/dpaste/views.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import datetime import difflib import json diff --git a/runtests.py b/runtests.py index ab4273d..cb56879 100755 --- a/runtests.py +++ b/runtests.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from __future__ import unicode_literals + import sys