Commit d260409d authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

flake8 and all

* update some copyright
* drop most __docformat__ declaration
* fix some flake8 warnings / errors
parent d8de1ac21f36
......@@ -17,8 +17,6 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""Core hooks: synchronize living session on persistent data changes"""
__docformat__ = "restructuredtext en"
from cubicweb import _
from cubicweb import UnknownProperty, BadConnectionId, validation_error
from cubicweb.predicates import is_instance
......
# copyright 2010-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# copyright 2010-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
......@@ -27,6 +27,7 @@ from cubicweb import validation_error
from cubicweb.predicates import is_instance
from cubicweb.server import SOURCE_TYPES, hook
class SourceHook(hook.Hook):
__abstract__ = True
category = 'cw.sources'
......
......@@ -17,7 +17,7 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""Core hooks: workflow related hooks"""
__docformat__ = "restructuredtext en"
from cubicweb import _
from datetime import datetime
......
......@@ -18,7 +18,7 @@
"""Some i18n/gettext utilities."""
from __future__ import print_function
__docformat__ = "restructuredtext en"
import re
import os
......
......@@ -17,7 +17,7 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""Common utilies to format / send emails."""
__docformat__ = "restructuredtext en"
from base64 import b64encode, b64decode
from time import time
......
......@@ -18,7 +18,7 @@
"""utilities for instances migration"""
from __future__ import print_function
__docformat__ = "restructuredtext en"
import sys
import os
......
from datetime import datetime
for rtype in ('cw_support', 'cw_dont_cross', 'cw_may_cross'):
drop_relation_type(rtype)
......
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
......@@ -15,10 +15,11 @@
#
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""allways executed before all others in server migration
"""Always executed before all others in server migration
it should only include low level schema changes
"""
from __future__ import print_function
from six import text_type
......
......@@ -21,7 +21,7 @@ to be available in the standard migration environment
"""
from __future__ import print_function
__docformat__ = "restructuredtext en"
def drop_entity_types_fast(*etypes, **kwargs):
"""drop an entity type bypassing all hooks
......
......@@ -17,7 +17,7 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""mime type transformation engine for cubicweb, based on mtconverter"""
__docformat__ = "restructuredtext en"
from logilab import mtconverter
......
......@@ -18,7 +18,7 @@
"""Predicate classes
"""
__docformat__ = "restructuredtext en"
import logging
from warnings import warn
......
......@@ -17,8 +17,6 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""Base class for request/session"""
__docformat__ = "restructuredtext en"
from warnings import warn
from datetime import time, datetime, timedelta
......
......@@ -20,7 +20,7 @@ tree.
This is used for instance for read security checking in the repository.
"""
__docformat__ = "restructuredtext en"
from six import text_type, string_types
......
......@@ -16,7 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""The `ResultSet` class which is returned as result of an rql query"""
__docformat__ = "restructuredtext en"
from warnings import warn
......
......@@ -35,7 +35,7 @@ Three primitives are defined:
* ``tag_object_of`` tag a relation in the object's context
* ``tag_attribute`` shortcut for tag_subject_of
"""
__docformat__ = "restructuredtext en"
import logging
from warnings import warn
......
......@@ -16,9 +16,8 @@
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""classes to define schemas for CubicWeb"""
from __future__ import print_function
__docformat__ = "restructuredtext en"
from __future__ import print_function
import re
from os.path import join, basename
......
......@@ -18,7 +18,7 @@
"""the Bookmark entity type for internal links
"""
__docformat__ = "restructuredtext en"
from cubicweb import _
from yams.buildobjs import EntityType, RelationType, SubjectRelation, String
......
......@@ -17,7 +17,7 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""some constants and classes to define schema permissions"""
__docformat__ = "restructuredtext en"
from cubicweb.schema import RO_REL_PERMS, RO_ATTR_PERMS, \
PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS, \
......
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
......@@ -17,17 +17,15 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""core CubicWeb schema, but not necessary at bootstrap time"""
__docformat__ = "restructuredtext en"
from cubicweb import _
from yams.buildobjs import (EntityType, RelationType, RelationDefinition,
SubjectRelation,
String, TZDatetime, Datetime, Password, Interval,
Boolean, Bytes, UniqueConstraint)
SubjectRelation, String, Bytes, TZDatetime, Password)
from cubicweb import _
from cubicweb.schema import (
RQLConstraint, WorkflowableEntityType, ERQLExpression, RRQLExpression,
PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS,
RO_ATTR_PERMS)
PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS, RO_ATTR_PERMS)
class CWUser(WorkflowableEntityType):
"""define a CubicWeb user"""
......@@ -321,6 +319,7 @@ class CWDataImport(EntityType):
default='in progress',
vocabulary=[_('in progress'), _('success'), _('failed')])
class cw_import_of(RelationDefinition):
__permissions__ = RELATION_MANAGERS_PERMISSIONS
subject = 'CWDataImport'
......
......@@ -18,7 +18,7 @@
"""core CubicWeb schema necessary for bootstrapping the actual instance's schema
"""
__docformat__ = "restructuredtext en"
from cubicweb import _
from yams.buildobjs import (EntityType, RelationType, RelationDefinition, Bytes,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment