def _present_graph(dot_filename, filename=None):
    if filename == dot_filename:
        # nothing to do, the user asked for a .dot file and got it
        return
    if not filename and _program_in_path('xdot'):
        print("Spawning graph viewer (xdot)")
        subprocess.Popen(['xdot', dot_filename], close_fds=True)
    elif _program_in_path('dot'):
        if not filename:
            print("Graph viewer (xdot) not found, generating a png instead")
            filename = dot_filename[:-4] + '.png'
        stem, ext = os.path.splitext(filename)
        cmd = ['dot', '-T' + ext[1:], '-o' + filename, dot_filename]
        dot = subprocess.Popen(cmd, close_fds=False)
        dot.wait()
        if dot.returncode != 0:
            # XXX: shouldn't this go to stderr or a log?
            print('dot failed (exit code %d) while executing "%s"'
                  % (dot.returncode, ' '.join(cmd)))
        else:
            print("Image generated as %s" % filename)
    else:
        if not filename:
            print("Graph viewer (xdot) and image renderer (dot) not found,"
                  " not doing anything else")
        else:
            print("Image renderer (dot) not found, not doing anything else")
Uses ObjManipCommand.parse()
dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/dep/objgraph.py/_present_graph--crossover with--dataset/ETHPy150Open evennia/evennia/evennia/commands/default/building.py/CmdCopy.func