def filediff(a, b, flags): # Display differences between two text files diffcmd = "diff" if flags: diffcmd = diffcmd + mkarg(flags) diffcmd = diffcmd + mkarg(a) + mkarg(b) difftext = commands.getoutput(diffcmd) return textwin.open_readonly(mktitle(a, b), difftext)
def filediff(a, b, flags): # Display differences between two text files diffcmd = 'diff' if flags: diffcmd = diffcmd + mkarg(flags) diffcmd = diffcmd + mkarg(a) + mkarg(b) difftext = commands.getoutput(diffcmd) return textwin.open_readonly(mktitle(a, b), difftext)
def open_readonly(fn): # Open a file window fp = __builtin__.open(fn, 'r') w = textwin.open_readonly(fn, fp.read()) w.fn = fn return w
def open_readonly(fn): # Open a file window w = textwin.open_readonly(fn, readfile(fn)) w.fn = fn return w