mirror of
https://github.com/nims11/IPod-Shuffle-4g.git
synced 2025-12-08 00:18:01 +09:00
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 shutil
|
||||||
import re
|
import re
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import signal
|
||||||
|
|
||||||
audio_ext = (".mp3", ".m4a", ".m4b", ".m4p", ".aa", ".wav")
|
audio_ext = (".mp3", ".m4a", ".m4b", ".m4p", ".aa", ".wav")
|
||||||
list_ext = (".pls", ".m3u")
|
list_ext = (".pls", ".m3u")
|
||||||
|
|
@ -580,7 +581,12 @@ def checkPathValidity(path):
|
||||||
print 'Unable to get write permissions in the IPod directory'
|
print 'Unable to get write permissions in the IPod directory'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def handle_interrupt(signal, frame):
|
||||||
|
print "Interrupt detected, exiting..."
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
signal.signal(signal.SIGINT, handle_interrupt)
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--disable-voiceover', action='store_true', help='Disable voiceover feature')
|
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')
|
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