Code Duplication    Length = 14-15 lines in 2 locations

rna_tools/tools/PyMOL4RNA/PyMOL4RNA.py 2 locations

@@ 919-933 (lines=15) @@
916
917
cmd.extend('edges', edges)
918
919
def fr(selection):
920
    """Save selection into a file in a temp folder and run rna_draw_edges.py on it and load it into this session"""
921
    my_view = cmd.get_view()
922
    f = tempfile.TemporaryDirectory()
923
    tmpf = f.name + os.sep + strip_selection_name(selection) + '.pdb'
924
    outf = f.name + '/output.py'
925
    cmd.save(tmpf, selection)
926
    path = "/Users/magnus/work/src/rna-tools/rna_tools/tools/PyMOL4RNA/"
927
    cmdline = path + 'rna_draw_frames.py --name %s %s > %s' % (strip_selection_name(selection), tmpf, outf)
928
    print(cmdline)
929
    out, err = exe(cmdline)
930
    if err:
931
        print(err)
932
    cmd.load(outf)
933
    cmd.set_view(my_view)
934
935
cmd.extend('fr', fr)
936
@@ 902-915 (lines=14) @@
899
    return selection_name.replace('(', '').replace(')', '')
900
901
902
def edges(selection):
903
    """Save selection into a file in a temp folder and run rna_draw_edges.py on it and load it into this session"""
904
    my_view = cmd.get_view()
905
    f = tempfile.TemporaryDirectory()
906
    tmpf = f.name + os.sep + strip_selection_name(selection) + '.pdb'
907
    outf = f.name + '/output.py'
908
    cmd.save(tmpf, selection)
909
    cmdline = '/Users/magnus/miniconda3/bin/rna_draw_edges.py --name %s %s > %s' % (strip_selection_name(selection), tmpf, outf)
910
    print(cmdline)
911
    out, err = exe(cmdline)
912
    if err:
913
        print(err)
914
    cmd.load(outf)
915
    cmd.set_view(my_view)
916
917
cmd.extend('edges', edges)
918