Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
yams
Commits
42a10ebbf28b
Commit
b8127cb9
authored
Jul 28, 2021
by
Laurent Peuch
Browse files
chore(format-source): pyupgrade the code
parent
c3ee206c7d80
Changes
9
Hide whitespace changes
Inline
Side-by-side
.hg-format-source
View file @
42a10ebb
...
...
@@ -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"}
setup.py
View file @
42a10ebb
...
...
@@ -23,7 +23,6 @@
__docformat__
=
"restructuredtext en"
import
os.path
as
osp
from
io
import
open
from
setuptools
import
setup
,
find_packages
...
...
test/unittest_schema.py
View file @
42a10ebb
# -*- coding: iso-8859-1 -*-
# copyright 2004-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
...
...
test/unittest_schema2dot.py
View file @
42a10ebb
...
...
@@ -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"
)
...
...
yams/buildobjs.py
View file @
42a10ebb
...
...
@@ -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
:
...
...
yams/diff.py
View file @
42a10ebb
...
...
@@ -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
...
...
yams/reader.py
View file @
42a10ebb
...
...
@@ -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
...
...
yams/schema2dot.py
View file @
42a10ebb
...
...
@@ -18,7 +18,6 @@
"""Write a schema as a dot file.
"""
from
__future__
import
print_function
import
sys
import
os.path
as
osp
...
...
yams/tools.py
View file @
42a10ebb
"""some yams command line tools"""
from
__future__
import
print_function
import
sys
from
os.path
import
exists
,
join
,
dirname
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment