Skip to content

Commit

Permalink
Merge branch 'feature/export-truncate-str' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Oct 5, 2020
2 parents 128dea1 + 930cb49 commit bc9669b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
32 changes: 17 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,25 @@ please take a look at related PRs and issues and see if the change affects you.

### Fixed

- Fixed bug where (Ext)RelativeName scope providers accepted any referenced
object that contained the lookup name in its name. Thanks ipa-mdl@GitHub
([#267])
- Fixed bug in `flow_dsl` test project causing static files not being included
in package build/installation. Thanks sebix@GitHub ([#272]).
- Fixed bug, where user classes not used in the grammar caused exceptions
([#270]): now, when passing a list of user classes, you need to use them in
your grammar. You can alternatively also pass a callable (see metamodel.md;
[#273]). Also, using base classes for rules from imported grammars in
conjunction with user classes is not allowed and results in an exception.
- Fixed bug in `export.py` concerning html escaping in the dot export of a
textx meta-model ([#276]).
- Fixed bug where (Ext)RelativeName scope providers accepted any referenced
object that contained the lookup name in its name. Thanks ipa-mdl@GitHub
([#267])
- Fixed bug in `flow_dsl` test project causing static files not being included
in package build/installation. Thanks sebix@GitHub ([#272]).
- Fixed bug, where user classes not used in the grammar caused exceptions
([#270]): now, when passing a list of user classes, you need to use them in
your grammar. You can alternatively also pass a callable (see metamodel.md;
[#273]). Also, using base classes for rules from imported grammars in
conjunction with user classes is not allowed and results in an exception.
- Fixed bug in `export.py` concerning html escaping in the dot export of a
textx meta-model ([#276]).

### Changed

- Changed `unhashable type` exception when a list is used for `name` attributes by
raising a more informative exception and extending docs to document the issue
and a proper way to solve it ([#40], [#266]).
- Truncate long strings during dot export for better diagram readability ([#282]).
- Changed `unhashable type` exception when a list is used for `name` attributes by
raising a more informative exception and extending docs to document the issue
and a proper way to solve it ([#40], [#266]).


## [v2.2.0] (released: 2020-08-03)
Expand Down Expand Up @@ -489,6 +490,7 @@ please take a look at related PRs and issues and see if the change affects you.
- Export to dot.


[#282]: https://github.com/textX/textX/pull/282
[#281]: https://github.com/textX/textX/pull/281
[#276]: https://github.com/textX/textX/pull/276
[#274]: https://github.com/textX/textX/pull/274
Expand Down
6 changes: 5 additions & 1 deletion textx/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ def html_escape(s):

def dot_repr(o):
if type(o) is text:
return "'{}'".format(dot_escape(text(o)))
escaped = dot_escape(text(o))
if len(escaped) > 20:
return "'{}...'".format(escaped[:20])
else:
return "'{}'".format(escaped)
else:
return text(o)

Expand Down

0 comments on commit bc9669b

Please sign in to comment.