Closed GoogleCodeExporter closed 8 years ago
Import the pyNsourceGui.py attached to see the problem. It may also be
reproducible with the current pyNsourceGui.py being developed.
Note the IMPORT and rendering is ok. Its just switching to ascii view that has
gone a bit iffy.
Original comment by abu...@gmail.com
on 6 Aug 2012 at 1:27
Attachments:
Seems to be an issue re imprting code which uses multiple inheritance.
Reproduced the problem by importing:
class Fred(Mary, Sam):
pass
Original comment by abu...@gmail.com
on 8 Aug 2012 at 7:02
Attachments:
This issue was updated by revision r473.
Preparing to debug multiple inheritance parsing bug, adding unit tests to catch
it.
Original comment by abu...@gmail.com
on 8 Aug 2012 at 8:10
This issue was updated by revision r518.
ast_parser - switched pynsourcegui to the new ast parser! Fixed multiple
inheritence parsing bug.
Still have multiple inheritance crash when switch to ascii uml view because of
graph.py sort by generalisation algorithm introducing duplicates.
Original comment by abu...@gmail.com
on 17 Aug 2012 at 7:41
This issue was updated by revision r519.
Moved graph node tests into testing dir. One test that is failing is the one
we have to solve to fix this bug.
Original comment by abu...@gmail.com
on 17 Aug 2012 at 8:17
The problem of multiple inheritance means new 'ordering' and 'annotation'
decisions were needed for multiple inheritance cases.
The final solution of [('M', 'root'), ('F', 'root'), ('S', 'root')] meant
treating all as roots, then adding extra logic to the ascii rendering stage so
that multiple parents were picked up and drawn as aliases e.g. not fully
rendered classes but rather a class in square brackets e.g. [classname] above
the child with multiple parents.
Original comment by abu...@gmail.com
on 19 Aug 2012 at 3:35
Attachments:
This issue was updated by revision r520.
Fixed ascii rendering problem in cases of multiple inheritance.
Original comment by abu...@gmail.com
on 19 Aug 2012 at 3:36
HOW IT WORKS
============
unit tests in
test_graph_nodes.py
test_asciiworkspace_01.py
test_asciiworkspace_02.py
This layout is generated from the graph model and relies on the call
graph.nodes_sorted_by_generalisation()
which returns the nodes in an order conducive to ascii layout.
The order of nodes returned is something like:
[('A', 'root'), ('B', 'fc'), ('D', 'tab'), ('F', 'tab'), ('C', 'fc'), ('H',
'fc'), ('E', 'root')]
or
[(m, 'root'), (s, 'root'), (f, 'root')]
Where root means start a newline and render a box. (exception to this is where
you have multiple roots by themselves, then we spread them out across the page)
Where 'fc' means first child under a root. Usually a subclass rendered along
the left edge of the page.
Where 'tab' means tab out to the next column in the same row.
Sometimes to avoid wiring cross-overs, we write out a class a second time as
an 'alias' which looks like this:
+------+
| Mary |
+------+
[ Mary ][ Sam ] +-----+
. | Sam |
/_\ +-----+
|
|
|
+------+
| Fred |
+------+
Aliases appear in [nnnnn] square brackets.
The utility class 'asciiworkspace' is a nice class which looks after organising
things in rows and columns with appropriate padding. You send it chunks of text
and flush/newline commands and it will appear in a nice grid format.
Original comment by abu...@gmail.com
on 19 Aug 2012 at 4:04
This issue was updated by revision r521.
Moved ascii_uml modules into its own package. Added documentation.
Original comment by abu...@gmail.com
on 19 Aug 2012 at 4:08
Fixed.
Original comment by abu...@gmail.com
on 19 Aug 2012 at 4:08
Original issue reported on code.google.com by
abu...@gmail.com
on 6 Aug 2012 at 1:24