mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 00:28:25 +03:00
pySim-fairwaves-prog: Add an option to play sound on successful write in the batch mode.
Change-Id: I440a1fd30abfaf95da2daf7b618f6c25c3b092d4
This commit is contained in:
@@ -24,6 +24,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import csv
|
import csv
|
||||||
import random
|
import random
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from pySim.commands import SimCardCommands
|
from pySim.commands import SimCardCommands
|
||||||
from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, derive_milenage_opc
|
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.",
|
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",
|
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",
|
parser.add_option("-n", "--name", dest="name",
|
||||||
help="Operator name [default: %default]",
|
help="Operator name [default: %default]",
|
||||||
default="Fairwaves",
|
default="Fairwaves",
|
||||||
@@ -270,3 +274,5 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
sim_keys = program_sim_card(card, sim_db, opts)
|
sim_keys = program_sim_card(card, sim_db, opts)
|
||||||
write_params_csv(opts.out_db_filename, sim_keys)
|
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])
|
||||||
|
|||||||
Reference in New Issue
Block a user