Ticket #2734: interacive_mode_fixes.patch

File interacive_mode_fixes.patch, 905 bytes (added by visit0r, 17 years ago)

More informative printout when multiple titles are found + uses 'readline' lib, if available, to read lines in interactive mode.

  • mythvideo/mythvideo/scripts/find_meta.py

    old new  
    6060
    6161verbose=False
    6262
     63try:
     64    # For better line editing in interactive mode. Optional.
     65    import readline
     66except:
     67    pass
     68
    6369interactive=False
    6470recursive=False
    6571dbimport=False
     
    593599                        if len(candidates) > 1:
    594600
    595601                                print "Got multiple candidates for title search '%s'. " % title
    596                                 print "Use the '-a' switch to choose the correct one."
     602                                if not interactive:
     603                                        print "Use the '-a' or '-i' switch to choose the correct one."
    597604                                for candidate in candidates:
    598605                                        print "%s) %s (%d)" % (candidate[0], candidate[1], candidate[2])
    599606