From nobody Thu Apr 25 00:21:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521184290654507.1890731842476; Fri, 16 Mar 2018 00:11:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B720880F98; Fri, 16 Mar 2018 07:11:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB12017149; Fri, 16 Mar 2018 07:11:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A0CB64CA98; Fri, 16 Mar 2018 07:11:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2G7BRgY022569 for ; Fri, 16 Mar 2018 03:11:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 081682166BDA; Fri, 16 Mar 2018 07:11:27 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-97.pek2.redhat.com [10.72.12.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE1692166BAE; Fri, 16 Mar 2018 07:11:25 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 16 Mar 2018 15:11:19 +0800 Message-Id: <20180316071120.22410-2-famz@redhat.com> In-Reply-To: <20180316071120.22410-1-famz@redhat.com> References: <20180316071120.22410-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/2] api: Fix import of Group X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 16 Mar 2018 07:11:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- api/apps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/apps.py b/api/apps.py index db36c9f..c7fc162 100644 --- a/api/apps.py +++ b/api/apps.py @@ -16,7 +16,7 @@ import mod _default_groups =3D ['maintainers', 'testers', 'importers'] =20 def create_default_groups(): - from .models import Group + from django.contrib.auth.models import Group for grp in _default_groups: Group.objects.get_or_create(name=3Dgrp) =20 --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Thu Apr 25 00:21:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521184291411452.9110937431267; Fri, 16 Mar 2018 00:11:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6449DC04BE1F; Fri, 16 Mar 2018 07:11:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5899560F87; Fri, 16 Mar 2018 07:11:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4D1B01809547; Fri, 16 Mar 2018 07:11:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2G7BTEi022580 for ; Fri, 16 Mar 2018 03:11:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 131092166BB2; Fri, 16 Mar 2018 07:11:29 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-97.pek2.redhat.com [10.72.12.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FD062166BAE; Fri, 16 Mar 2018 07:11:27 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Fri, 16 Mar 2018 15:11:20 +0800 Message-Id: <20180316071120.22410-3-famz@redhat.com> In-Reply-To: <20180316071120.22410-1-famz@redhat.com> References: <20180316071120.22410-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/2] "autoflake" out unused imports X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 16 Mar 2018 07:11:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Fam Zheng --- api/admin.py | 1 - api/migrations/0019_populate_last_comment_date.py | 2 +- api/migrations/0021_fix_recipients_utf8.py | 2 +- api/migrations/0025_populate_project_maintainers.py | 2 +- api/models.py | 4 +--- api/views.py | 1 - mod.py | 2 -- mods/diff.py | 7 +------ mods/email.py | 1 - mods/git.py | 4 +--- mods/testing.py | 4 ---- patchew/urls.py | 1 - tests/test_custom_tags.py | 1 - tests/test_diff.py | 1 - tests/test_git.py | 3 --- tests/test_message.py | 2 -- tests/test_model.py | 3 --- tests/test_project.py | 2 -- tests/test_rest.py | 6 +----- tests/test_tags.py | 1 - tests/test_testing.py | 3 +-- www/views.py | 1 - 22 files changed, 8 insertions(+), 46 deletions(-) diff --git a/api/admin.py b/api/admin.py index c7ca190..6c8aa17 100644 --- a/api/admin.py +++ b/api/admin.py @@ -11,7 +11,6 @@ from django.contrib import admin from .models import * from mod import get_module -from django.contrib.auth.models import User, Group =20 class ProjectPropertyInline(admin.TabularInline): model =3D ProjectProperty diff --git a/api/migrations/0019_populate_last_comment_date.py b/api/migrat= ions/0019_populate_last_comment_date.py index f9d755f..093fa77 100644 --- a/api/migrations/0019_populate_last_comment_date.py +++ b/api/migrations/0019_populate_last_comment_date.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals =20 -from django.db import migrations, models +from django.db import migrations import json =20 =20 diff --git a/api/migrations/0021_fix_recipients_utf8.py b/api/migrations/00= 21_fix_recipients_utf8.py index ef02209..47bb86f 100644 --- a/api/migrations/0021_fix_recipients_utf8.py +++ b/api/migrations/0021_fix_recipients_utf8.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals =20 -from django.db import migrations, models +from django.db import migrations import json import email.header =20 diff --git a/api/migrations/0025_populate_project_maintainers.py b/api/migr= ations/0025_populate_project_maintainers.py index e029e70..3f9f3aa 100644 --- a/api/migrations/0025_populate_project_maintainers.py +++ b/api/migrations/0025_populate_project_maintainers.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals =20 -from django.db import migrations, models +from django.db import migrations from django.db.models import Count import json =20 diff --git a/api/models.py b/api/models.py index 277c112..15da8fb 100644 --- a/api/models.py +++ b/api/models.py @@ -17,12 +17,10 @@ import uuid import logging from django.conf import settings from django.db import models -from django.db.models import Q -from django.contrib.auth.models import User, Group +from django.contrib.auth.models import User from django.urls import reverse from mbox import MboxMessage from event import emit_event, declare_event -from django.contrib import admin import lzma =20 def save_blob(data, name=3DNone): diff --git a/api/views.py b/api/views.py index 27c8775..2d84be8 100644 --- a/api/views.py +++ b/api/views.py @@ -8,7 +8,6 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 -from django.shortcuts import render from django.views.generic import View from django.contrib.auth import authenticate, login, logout from django.http import HttpResponse, Http404 diff --git a/mod.py b/mod.py index 3a86cc5..90880ea 100644 --- a/mod.py +++ b/mod.py @@ -15,8 +15,6 @@ from django.conf import settings from django.template import Template, Context import traceback import configparser -import io -import json from schema import * =20 class PatchewModule(object): diff --git a/mods/diff.py b/mods/diff.py index 38404e0..197e31e 100644 --- a/mods/diff.py +++ b/mods/diff.py @@ -8,22 +8,17 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 -import os -import shutil -import hashlib from collections import namedtuple from django.conf.urls import url -from django.http import Http404 from django.urls import reverse from django.utils.html import format_html from django.utils.safestring import mark_safe from django.db.models import Exists, OuterRef from mod import PatchewModule -from api.models import Project, Message +from api.models import Message from api.rest import PluginMethodField import rest_framework from www.views import render_page -from schema import * import re =20 _instance =3D None diff --git a/mods/email.py b/mods/email.py index 0517864..72e8f2b 100644 --- a/mods/email.py +++ b/mods/email.py @@ -19,7 +19,6 @@ import smtplib import email import email.utils import uuid -import traceback from api.models import Message, Project from event import register_handler, get_events_info from schema import * diff --git a/mods/git.py b/mods/git.py index 4fd7dbe..e646654 100644 --- a/mods/git.py +++ b/mods/git.py @@ -10,8 +10,6 @@ =20 import os import subprocess -import tempfile -import shutil import hashlib from django.conf.urls import url from django.http import Http404, HttpResponseRedirect @@ -20,7 +18,7 @@ from django.core.exceptions import PermissionDenied from django.utils.html import format_html from mod import PatchewModule from event import declare_event, register_handler, emit_event -from api.models import Project, Message, MessageProperty +from api.models import Message, MessageProperty from api.views import APILoginRequiredView, prepare_series from patchew.logviewer import LogView from schema import * diff --git a/mods/testing.py b/mods/testing.py index 24bd509..d6492aa 100644 --- a/mods/testing.py +++ b/mods/testing.py @@ -13,12 +13,8 @@ from django.http import HttpResponseForbidden, Http404, = HttpResponseRedirect from django.core.exceptions import PermissionDenied from django.urls import reverse from django.utils.html import format_html -from django.template import Template, Context from mod import PatchewModule import time -import smtplib -import email -import traceback import math from api.views import APILoginRequiredView from api.models import Message, Project, MessageProperty diff --git a/patchew/urls.py b/patchew/urls.py index 2fd2d1d..08ace07 100644 --- a/patchew/urls.py +++ b/patchew/urls.py @@ -23,7 +23,6 @@ Including another URLconf 1. Import the include() function: from django.conf.urls import url, in= clude 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ -import os from django.conf.urls import include, url from api.admin import admin_site from django.conf.urls.static import static diff --git a/tests/test_custom_tags.py b/tests/test_custom_tags.py index aa828be..9ed2117 100755 --- a/tests/test_custom_tags.py +++ b/tests/test_custom_tags.py @@ -10,7 +10,6 @@ =20 from django.template import Context, Template from patchew.tags import tail_lines, grep_A, grep_B, grep_C, grep -import patchewtest import unittest =20 class CustomTagsTest(unittest.TestCase): diff --git a/tests/test_diff.py b/tests/test_diff.py index 41fb0b4..735c4e7 100755 --- a/tests/test_diff.py +++ b/tests/test_diff.py @@ -12,7 +12,6 @@ import sys import os sys.path.append(os.path.dirname(__file__)) from patchewtest import PatchewTestCase, main -import json =20 class DiffTest(PatchewTestCase): =20 diff --git a/tests/test_git.py b/tests/test_git.py index 4744ef4..c2c98ae 100755 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -10,11 +10,8 @@ =20 import sys import os -import re sys.path.append(os.path.dirname(__file__)) from patchewtest import PatchewTestCase, main -import json -import tempfile import shutil import subprocess from api.models import Message diff --git a/tests/test_message.py b/tests/test_message.py index 68a1282..8f2f75e 100755 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -8,8 +8,6 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 -import sys -import os import time import datetime from patchewtest import PatchewTestCase, main diff --git a/tests/test_model.py b/tests/test_model.py index 250a922..7e8853b 100755 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -8,11 +8,8 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 -import sys -import os from patchewtest import PatchewTestCase, main from api.models import Message -import json =20 class ImportTest(PatchewTestCase): =20 diff --git a/tests/test_project.py b/tests/test_project.py index 25b9661..eb06050 100755 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -8,8 +8,6 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 -import sys -import os from patchewtest import PatchewTestCase, main =20 class ProjectTest(PatchewTestCase): diff --git a/tests/test_rest.py b/tests/test_rest.py index 1a7285b..28ca10b 100755 --- a/tests/test_rest.py +++ b/tests/test_rest.py @@ -10,12 +10,8 @@ =20 import sys import os -import json -import tempfile -import shutil -import subprocess =20 -from django.contrib.auth.models import User, Group +from django.contrib.auth.models import User =20 sys.path.append(os.path.dirname(__file__)) from patchewtest import PatchewTestCase, main diff --git a/tests/test_tags.py b/tests/test_tags.py index d663b41..8469c42 100755 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -12,7 +12,6 @@ import sys import os sys.path.append(os.path.dirname(__file__)) from patchewtest import PatchewTestCase, main -import json =20 class ImportTest(PatchewTestCase): =20 diff --git a/tests/test_testing.py b/tests/test_testing.py index 0d7e316..0897bbc 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -10,11 +10,10 @@ =20 import sys import os -import datetime import subprocess sys.path.append(os.path.dirname(__file__)) from patchewtest import PatchewTestCase, main -from api.models import Message, Project +from api.models import Message =20 def create_test(project, name): prefix =3D "testing.tests." + name + "." diff --git a/www/views.py b/www/views.py index e12fa48..8965ebf 100644 --- a/www/views.py +++ b/www/views.py @@ -10,7 +10,6 @@ =20 import urllib.request, urllib.parse, urllib.error from django.shortcuts import render -from django.template import Context from django.http import HttpResponse, Http404 from django.db.models import Exists, OuterRef from django.urls import reverse --=20 2.14.3 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel