forked from upstream/IPod-Shuffle-4g
handle keyboard interrupt
This commit is contained in:
parent
002be77edb
commit
bcde228a62
1 changed files with 6 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ import argparse
|
|||
import shutil
|
||||
import re
|
||||
import tempfile
|
||||
import signal
|
||||
|
||||
audio_ext = (".mp3", ".m4a", ".m4b", ".m4p", ".aa", ".wav")
|
||||
list_ext = (".pls", ".m3u")
|
||||
|
|
@ -580,7 +581,12 @@ def checkPathValidity(path):
|
|||
print 'Unable to get write permissions in the IPod directory'
|
||||
sys.exit(1)
|
||||
|
||||
def handle_interrupt(signal, frame):
|
||||
print "Interrupt detected, exiting..."
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
signal.signal(signal.SIGINT, handle_interrupt)
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--disable-voiceover', action='store_true', help='Disable voiceover feature')
|
||||
parser.add_argument('--rename-unicode', action='store_true', help='Rename files causing unicode errors, will do minimal required renaming')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue