From b2b1f485be8a72f5fc5562f40474d5881acd00e5 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Thu, 14 Jul 2016 19:40:30 -0300 Subject: [PATCH] Arruma detalhes da PEP8 --- sapl/base/views.py | 4 ++-- sapl/comissoes/views.py | 6 +++--- sapl/materia/views.py | 7 ++++--- sapl/parlamentares/views.py | 8 +++----- sapl/protocoloadm/urls.py | 6 ++---- sapl/protocoloadm/views.py | 17 +++++++++-------- sapl/sessao/views.py | 2 +- sapl/utils.py | 3 --- scripts/inicializa_grupos_autorizacoes.py | 2 +- 9 files changed, 25 insertions(+), 30 deletions(-) diff --git a/sapl/base/views.py b/sapl/base/views.py index e04c9e0af..c52b5b6fa 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -3,8 +3,8 @@ from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.views.generic.base import TemplateView -from sapl.crud.base import Crud, CrudBaseMixin, CrudCreateView,\ - CrudDetailView, CrudUpdateView +from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, + CrudDetailView, CrudUpdateView) from sapl.utils import permissao_tb_aux from .forms import CasaLegislativaForm diff --git a/sapl/comissoes/views.py b/sapl/comissoes/views.py index 7051d3b15..4a23a49aa 100644 --- a/sapl/comissoes/views.py +++ b/sapl/comissoes/views.py @@ -1,12 +1,12 @@ -from django.core.urlresolvers import reverse from django.contrib.auth.mixins import PermissionRequiredMixin +from django.core.urlresolvers import reverse from django.views.generic import ListView from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, - CrudUpdateView, CrudDeleteView) + CrudDeleteView, CrudUpdateView) from sapl.crud.masterdetail import MasterDetailCrud from sapl.materia.models import Tramitacao -from sapl.utils import permissoes_comissoes, permissao_tb_aux +from sapl.utils import permissao_tb_aux, permissoes_comissoes from .models import (CargoComissao, Comissao, Composicao, Participacao, Periodo, TipoComissao) diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 8076bc49a..21f7de316 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -18,12 +18,13 @@ from django_filters.views import FilterView from sapl.base.models import CasaLegislativa from sapl.compilacao.views import IntegracaoTaView from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row -from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, CrudListView, - CrudUpdateView, CrudDeleteView, make_pagination) +from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, + CrudDeleteView, CrudListView, CrudUpdateView, + make_pagination) from sapl.crud.masterdetail import MasterDetailCrud from sapl.norma.models import LegislacaoCitada from sapl.utils import (autor_label, autor_modal, get_base_url, - permissoes_materia, permissao_tb_aux) + permissao_tb_aux, permissoes_materia) from .forms import (AcompanhamentoMateriaForm, AnexadaForm, AutoriaForm, DespachoInicialForm, DocumentoAcessorioForm, diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index f6abb062c..227bb1d38 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -1,5 +1,4 @@ from django.contrib import messages -from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType @@ -9,11 +8,10 @@ from django.utils.datastructures import MultiValueDictKeyError from django.utils.translation import ugettext_lazy as _ from django.views.generic import FormView -from sapl.crud.base import (Crud, CrudCreateView, CrudListView, CrudUpdateView, - CrudBaseMixin, CrudDeleteView) +from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, + CrudDeleteView, CrudListView, CrudUpdateView) from sapl.crud.masterdetail import MasterDetailCrud - -from sapl.utils import permissoes_parlamentares, permissao_tb_aux +from sapl.utils import permissao_tb_aux, permissoes_parlamentares from .forms import (ComposicaoColigacaoForm, FiliacaoForm, LegislaturaForm, ParlamentarCreateForm, ParlamentarForm) diff --git a/sapl/protocoloadm/urls.py b/sapl/protocoloadm/urls.py index c3c652a35..ea978ba1b 100644 --- a/sapl/protocoloadm/urls.py +++ b/sapl/protocoloadm/urls.py @@ -22,10 +22,8 @@ from sapl.protocoloadm.views import (AnularProtocoloAdmView, ProtocoloPesquisaView, StatusTramitacaoAdministrativoCrud, TipoDocumentoAdministrativoCrud, - TipoInstituicaoCrud, - TramitacaoAdmCrud, - get_nome_autor, - pesquisa_autores) + TipoInstituicaoCrud, TramitacaoAdmCrud, + get_nome_autor, pesquisa_autores) from .apps import AppConfig diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 72c95f835..86fe97d93 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -1,8 +1,6 @@ import json from datetime import date, datetime -import sapl.crud.base -from sapl.crud.masterdetail import MasterDetailCrud from braces.views import FormValidMessageMixin from django.contrib.auth.mixins import PermissionRequiredMixin from django.core.exceptions import ObjectDoesNotExist @@ -15,18 +13,21 @@ from django.views.generic import CreateView, DetailView, FormView, ListView from django.views.generic.base import TemplateView from django_filters.views import FilterView -from sapl.crud.base import (Crud, CrudBaseMixin, CrudListView, make_pagination, - CrudCreateView, CrudUpdateView, CrudDeleteView) +import sapl.crud.base +from sapl.crud.base import (Crud, CrudBaseMixin, CrudCreateView, + CrudDeleteView, CrudListView, CrudUpdateView, + make_pagination) +from sapl.crud.masterdetail import MasterDetailCrud from sapl.materia.models import Proposicao, TipoMateriaLegislativa -from sapl.utils import (create_barcode, get_client_ip, permissoes_protocoloadm, - permissoes_adm) +from sapl.utils import (create_barcode, get_client_ip, permissoes_adm, + permissoes_protocoloadm) from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm, DocumentoAdministrativoFilterSet, DocumentoAdministrativoForm, ProposicaoSimpleForm, ProtocoloDocumentForm, ProtocoloFilterSet, - ProtocoloMateriaForm, TramitacaoAdmForm, - TramitacaoAdmEditForm) + ProtocoloMateriaForm, TramitacaoAdmEditForm, + TramitacaoAdmForm) from .models import (Autor, DocumentoAcessorioAdministrativo, DocumentoAdministrativo, Protocolo, StatusTramitacaoAdministrativo, diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index e26de79f1..47b4aac4b 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -23,7 +23,7 @@ from sapl.materia.models import (Autoria, DocumentoAcessorio, from sapl.norma.models import NormaJuridica from sapl.parlamentares.models import Parlamentar from sapl.sessao.serializers import SessaoPlenariaSerializer -from sapl.utils import permissoes_sessao, permissoes_painel, permissao_tb_aux +from sapl.utils import permissao_tb_aux, permissoes_painel, permissoes_sessao from .forms import (BancadaForm, ExpedienteForm, ExpedienteMateriaForm, ListMateriaForm, MateriaOrdemDiaForm, MesaForm, diff --git a/sapl/utils.py b/sapl/utils.py index 9ad97a9a2..088319563 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -1,6 +1,5 @@ from datetime import date from functools import wraps -import os.path import magic from django.apps import apps @@ -8,11 +7,9 @@ from django.conf import settings from django.contrib import admin from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType -from django.core.checks import Warning, register from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from floppyforms import ClearableFileInput -import magic def get_settings_auth_user_model(): diff --git a/scripts/inicializa_grupos_autorizacoes.py b/scripts/inicializa_grupos_autorizacoes.py index 6ce8e9be8..21d43808f 100644 --- a/scripts/inicializa_grupos_autorizacoes.py +++ b/scripts/inicializa_grupos_autorizacoes.py @@ -1,4 +1,4 @@ -from django.contrib.auth.models import User, Group, Permission +from django.contrib.auth.models import Group, Permission, User from django.contrib.contenttypes.models import ContentType