Code Duplication    Length = 8-9 lines in 2 locations

goatools/godag_plot.py 1 location

@@ 171-179 (lines=9) @@
168
169
    # ----------------------------------------------------------------------------------
170
    # pydot
171
    def _plt_pydot(self, fout_img):
172
        """Plot using the pydot graphics engine."""
173
        dag = self._get_pydot_graph()
174
        img_fmt = os.path.splitext(fout_img)[1][1:]
175
        dag.write(fout_img, format=img_fmt)
176
        self.log.write("  {GO_USR:>3} usr {GO_ALL:>3} GOs  WROTE: {F}\n".format(
177
            F=fout_img,
178
            GO_USR=len(self.godag.go_sources),
179
            GO_ALL=len(self.godag.go2obj)))
180
181
    def _get_pydot_graph(self):
182
        """Given a DAG, return a pydot digraph object."""

goatools/gosubdag/plot/gosubdag_plot.py 1 location

@@ 157-164 (lines=8) @@
154
        dag = self.get_pydot_graph()
155
        self.wr_pydot_dag(fout_img, dag)
156
157
    def wr_pydot_dag(self, fout_img, dag):
158
        """Plot using the pydot graphics engine."""
159
        img_fmt = os.path.splitext(fout_img)[1][1:]
160
        dag.write(fout_img, format=img_fmt)
161
        self.log.write("  {GO_USR:>3} usr {GO_ALL:>3} GOs  WROTE: {F}\n".format(
162
            F=fout_img,
163
            GO_USR=len(self.gosubdag.go_sources),
164
            GO_ALL=len(dag.obj_dict['nodes'])))
165
166
    def get_pydot_graph(self):
167
        """Given a DAG, return a pydot digraph object."""