Code Duplication    Length = 14-15 lines in 2 locations

rna_tools/tools/PyMOL4RNA/PyMOL4RNA.py 2 locations

@@ 983-997 (lines=15) @@
980
981
cmd.extend('edges', edges)
982
983
def fr(selection):
984
    """Save selection into a file in a temp folder and run rna_draw_edges.py on it and load it into this session"""
985
    my_view = cmd.get_view()
986
    f = tempfile.TemporaryDirectory()
987
    tmpf = f.name + os.sep + strip_selection_name(selection) + '.pdb'
988
    outf = f.name + '/output.py'
989
    cmd.save(tmpf, selection)
990
    path = "/Users/magnus/work/src/rna-tools/rna_tools/tools/PyMOL4RNA/"
991
    cmdline = path + 'rna_draw_frames.py --name %s %s > %s' % (strip_selection_name(selection), tmpf, outf)
992
    print(cmdline)
993
    out, err = exe(cmdline)
994
    if err:
995
        print(err)
996
    cmd.load(outf)
997
    cmd.set_view(my_view)
998
999
cmd.extend('fr', fr)
1000
@@ 966-979 (lines=14) @@
963
    return selection_name.replace('(', '').replace(')', '')
964
965
966
def edges(selection):
967
    """Save selection into a file in a temp folder and run rna_draw_edges.py on it and load it into this session"""
968
    my_view = cmd.get_view()
969
    f = tempfile.TemporaryDirectory()
970
    tmpf = f.name + os.sep + strip_selection_name(selection) + '.pdb'
971
    outf = f.name + '/output.py'
972
    cmd.save(tmpf, selection)
973
    cmdline = '/Users/magnus/miniconda3/bin/rna_draw_edges.py --name %s %s > %s' % (strip_selection_name(selection), tmpf, outf)
974
    print(cmdline)
975
    out, err = exe(cmdline)
976
    if err:
977
        print(err)
978
    cmd.load(outf)
979
    cmd.set_view(my_view)
980
981
cmd.extend('edges', edges)
982