[PATCH 3 of 4 yams] [flake8] Manuel correction to make flake8 happy

Simon Chabot simon.chabot at logilab.fr
Fri Jan 17 18:32:21 CET 2020


# HG changeset patch
# User Simon Chabot <simon.chabot at logilab.fr>
# Date 1579281459 -3600
#      Fri Jan 17 18:17:39 2020 +0100
# Node ID 16e23605dc108cf8174af8309c6ccb599cd5bb8c
# Parent  e9da0ace7bdcf88da9de6f80e161701ffe843bea
# Available At https://hg.logilab.org/review/yams
#              hg pull https://hg.logilab.org/review/yams -r 16e23605dc10
[flake8] Manuel correction to make flake8 happy

diff --git a/__pkginfo__.py b/__pkginfo__.py
--- a/__pkginfo__.py
+++ b/__pkginfo__.py
@@ -50,10 +50,10 @@ install_requires = [
     'setuptools',
     'logilab-common >= 1.4.0',
     'logilab-database >= 1.11',
-    ]
+]
 
 classifiers = [
     "Programming Language :: Python",
     "Programming Language :: Python :: 3",
     "Programming Language :: Python :: 3 :: Only",
-    ]
+]
diff --git a/yams/constraints.py b/yams/constraints.py
--- a/yams/constraints.py
+++ b/yams/constraints.py
@@ -132,8 +132,7 @@ class BaseConstraint(object):
 
     def __eq__(self, other):
         return (
-            (self.type(), self.serialize()) ==
-            (other.type(), other.serialize())
+            (self.type(), self.serialize()) == (other.type(), other.serialize())
         )
 
     def __ne__(self, other):
@@ -409,13 +408,17 @@ class IntervalBoundConstraint(BaseConstr
         return True
 
     def _failed_message(self, entity, key, value):
-        if(self.minvalue is not None and
-           value < actual_value(self.minvalue, entity)):
+        if (
+            self.minvalue is not None
+            and value < actual_value(self.minvalue, entity)
+        ):
             return _("value %(KEY-value)s must be >= %(KEY-boundary)s"), {
                 key + '-value': value,
                 key + '-boundary': _message_value(self.minvalue)}
-        if(self.maxvalue is not None and
-           value > actual_value(self.maxvalue, entity)):
+        if (
+            self.maxvalue is not None
+            and value > actual_value(self.maxvalue, entity)
+        ):
             return _("value %(KEY-value)s must be <= %(KEY-boundary)s"), {
                 key + '-value': value,
                 key + '-boundary': _message_value(self.maxvalue)}
diff --git a/yams/schema.py b/yams/schema.py
--- a/yams/schema.py
+++ b/yams/schema.py
@@ -810,10 +810,10 @@ class RelationSchema(ERSchema):
                 continue
             if final != eschema.final:
                 if final:
-                    feschema, _ = subjschema, self.subjects()[0]
+                    feschema = subjschema
                     frschema, nfrschema = objschema, eschema
                 else:
-                    feschema, _ = self.subjects()[0], subjschema
+                    feschema = self.subjects()[0]
                     frschema, nfrschema = eschema, objschema
                 msg = ("ambiguous relation: '%(feschema)s.%(rtype)s' is final (%(frschema)s) "
                        "but not '%(nfeschema)s.%(rtype)s' (%(nfrschema)s)")



More information about the cubicweb-devel mailing list