cudadog / pydot

Automatically exported from code.google.com/p/pydot
MIT License
0 stars 0 forks source link

get_subgraph function has a bug #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call the get_subgraph function

What is the expected output? What do you see instead?
The expected output is a return type of Subgraph.  The current issue is a 
simple coding bug.  But I don't believe the implementation is correct.

What version of the product are you using? On what operating system?
1.02

Please provide any additional information below.

Here is the function fixed so that it doesn't fail.  As mentioned in the 
discussion group, I believe the subgraph functions as a whole need to be 
reviewed.  The subgraphs are being reconstructed incorrectly.

---------------------------------------------------------------------------
    def get_subgraph(self, name):

        match = []

        if self.obj_dict['subgraphs'].has_key( name ):

            sgraphs_obj_dict = self.obj_dict['subgraphs'].get( name )

            for obj_dict_list in sgraphs_obj_dict:
                match = [ Subgraph( obj_dict = obj_d ) for obj_d in 
obj_dict_list ]

        if len(match)==1:
            return match[0]

        return match
---------------------------------------------------------------------------

Original issue reported on code.google.com by chris.fe...@gmail.com on 7 Jul 2009 at 1:42

GoogleCodeExporter commented 9 years ago
There is already a defect entry for this issue.  This defect is a duplicate.

Original comment by chris.fe...@gmail.com on 7 Jul 2009 at 1:44

GoogleCodeExporter commented 9 years ago

Original comment by ero.carr...@gmail.com on 31 Oct 2010 at 12:19