cubicweb/toolsutils.py
branch3.26
changeset 12321 e116275bf1ac
parent 11767 432f87a63057
child 12312 a7c4b13a2d60
equal deleted inserted replaced
12320:d46753a9a2a5 12321:e116275bf1ac
    94     """interactivly replace the old file with the new file according to
    94     """interactivly replace the old file with the new file according to
    95     user decision
    95     user decision
    96     """
    96     """
    97     import shutil
    97     import shutil
    98     pipe = subprocess.Popen(['diff', '-u', appl_file, ref_file], stdout=subprocess.PIPE)
    98     pipe = subprocess.Popen(['diff', '-u', appl_file, ref_file], stdout=subprocess.PIPE)
    99     diffs = pipe.stdout.read()
    99     diffs = pipe.stdout.read().decode('utf-8')
   100     if diffs:
   100     if diffs:
   101         if askconfirm:
   101         if askconfirm:
   102             print()
   102             print()
   103             print(diffs)
   103             print(diffs)
   104             action = ASK.ask('Replace ?', ('Y', 'n', 'q'), 'Y').lower()
   104             action = ASK.ask('Replace ?', ('Y', 'n', 'q'), 'Y').lower()