From 3a27424ff8956e1e1675a5bfa8128a17d365d134 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Fri, 26 Jan 2018 15:53:26 +0900 Subject: pySim-fairwaves-prog: Add an option to play sound on successful write in the batch mode. Change-Id: I440a1fd30abfaf95da2daf7b618f6c25c3b092d4 --- pySim-fairwaves-prog.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pySim-fairwaves-prog.py b/pySim-fairwaves-prog.py index b709af9..1f44d35 100755 --- a/pySim-fairwaves-prog.py +++ b/pySim-fairwaves-prog.py @@ -24,6 +24,7 @@ import os import sys import csv import random +import subprocess from pySim.commands import SimCardCommands from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, derive_milenage_opc @@ -208,6 +209,9 @@ def parse_options(): help="Process SIM cards in batch mode - don't exit after programming and wait for the next SIM card to be inserted.", default=False, action="store_true", ) + parser.add_option("--sound", dest="sound_file", type='string', metavar="SOUND_FILE", + help="Only in the batch mode. Play the given sound file on successful SIM programming", + ) parser.add_option("-n", "--name", dest="name", help="Operator name [default: %default]", default="Fairwaves", @@ -270,3 +274,5 @@ if __name__ == '__main__': sim_keys = program_sim_card(card, sim_db, opts) write_params_csv(opts.out_db_filename, sim_keys) + if opts.sound_file is not None and opts.sound_file != "": + subprocess.call(["paplay", opts.sound_file]) -- cgit v1.2.3