Commit b8127cb9 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

chore(format-source): pyupgrade the code

parent c3ee206c7d80
......@@ -68,3 +68,38 @@
{"pattern": "yams/tools.py", "tool": "autoflake"}
{"pattern": "yams/types.py", "tool": "autoflake"}
{"pattern": "yams/xy.py", "tool": "autoflake"}
{"pattern": "__pkginfo__.py", "tool": "pyupgrade"}
{"pattern": "docs/conf.py", "tool": "pyupgrade"}
{"pattern": "setup.py", "tool": "pyupgrade"}
{"pattern": "test/data/__init__.py", "tool": "pyupgrade"}
{"pattern": "test/data/dbmodel/__init__.py", "tool": "pyupgrade"}
{"pattern": "test/data/dbmodel/blog.py", "tool": "pyupgrade"}
{"pattern": "test/data/schema/Company.py", "tool": "pyupgrade"}
{"pattern": "test/data/schema/Dates.py", "tool": "pyupgrade"}
{"pattern": "test/data/schema/State.py", "tool": "pyupgrade"}
{"pattern": "test/data/schema/__init__.py", "tool": "pyupgrade"}
{"pattern": "test/data/schema/schema.py", "tool": "pyupgrade"}
{"pattern": "test/data/schema_post_build_callback.py", "tool": "pyupgrade"}
{"pattern": "test/data2/__init__.py", "tool": "pyupgrade"}
{"pattern": "test/data2/schema.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_constraints.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_diff.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_reader.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_schema.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_schema2dot.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_serialize.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_specialization.py", "tool": "pyupgrade"}
{"pattern": "test/unittest_xy.py", "tool": "pyupgrade"}
{"pattern": "yams/__init__.py", "tool": "pyupgrade"}
{"pattern": "yams/_exceptions.py", "tool": "pyupgrade"}
{"pattern": "yams/buildobjs.py", "tool": "pyupgrade"}
{"pattern": "yams/constraints.py", "tool": "pyupgrade"}
{"pattern": "yams/diff.py", "tool": "pyupgrade"}
{"pattern": "yams/interfaces.py", "tool": "pyupgrade"}
{"pattern": "yams/reader.py", "tool": "pyupgrade"}
{"pattern": "yams/schema.py", "tool": "pyupgrade"}
{"pattern": "yams/schema2dot.py", "tool": "pyupgrade"}
{"pattern": "yams/serialize.py", "tool": "pyupgrade"}
{"pattern": "yams/tools.py", "tool": "pyupgrade"}
{"pattern": "yams/types.py", "tool": "pyupgrade"}
{"pattern": "yams/xy.py", "tool": "pyupgrade"}
......@@ -23,7 +23,6 @@
__docformat__ = "restructuredtext en"
import os.path as osp
from io import open
from setuptools import setup, find_packages
......
# -*- coding: iso-8859-1 -*-
# copyright 2004-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
......
......@@ -49,8 +49,8 @@ splines=true
class DotTC(TestCase):
def test_schema2dot(self):
"""tests dot conversion without attributes information"""
wanted_entities = set(("Person", "Salaried", "Societe"))
skipped_entities = set(ent for ent in schema.entities() if ent.type not in wanted_entities)
wanted_entities = {"Person", "Salaried", "Societe"}
skipped_entities = {ent for ent in schema.entities() if ent.type not in wanted_entities}
schema2dot.schema2dot(schema, "toto.dot", skiptypes=skipped_entities)
generated = open("toto.dot").read()
os.remove("toto.dot")
......
......@@ -1080,9 +1080,9 @@ class RelationDefinition(Definition):
relation_schema = schema.relation_schema_for(yams_types.DefinitionName(name))
if relation_schema.rule:
raise BadSchemaDefinition(
'Cannot add relation definition "{0}" because an '
'Cannot add relation definition "{}" because an '
"homonymous computed relation already exists "
'with rule "{1}"'.format(relation_schema.type, relation_schema.rule)
'with rule "{}"'.format(relation_schema.type, relation_schema.rule)
)
if self.__permissions__ is MARKER:
......
......@@ -20,7 +20,6 @@
Textual representation of schema are created and standard diff algorithm are
applied.
"""
from __future__ import print_function
import subprocess
import tempfile
......
......@@ -20,7 +20,6 @@
Use either a sql derivated language for entities and relation definitions
files or a direct python definition file.
"""
from __future__ import print_function
import sys
import os
......
......@@ -18,7 +18,6 @@
"""Write a schema as a dot file.
"""
from __future__ import print_function
import sys
import os.path as osp
......
"""some yams command line tools"""
from __future__ import print_function
import sys
from os.path import exists, join, dirname
......
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