Change in pysim[master]: pySim-prog: rename card_handler to CardHandler

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Mon Sep 20 08:09:30 UTC 2021


dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/25499 )

Change subject: pySim-prog: rename card_handler to CardHandler
......................................................................

pySim-prog: rename card_handler to CardHandler

In OOP, we usually use capital letters for class names. The card handler
class should be no execption.

Change-Id: I4b2c06b1c607c993c9aaf0d57ad2352bb6b36e74
---
M pySim-prog.py
M pySim-shell.py
M pySim/card_handler.py
3 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  dexter: Looks good to me, approved



diff --git a/pySim-prog.py b/pySim-prog.py
index 922ca86..3b69bb3 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -741,9 +741,9 @@
 	init_batch(opts)
 
 	if opts.card_handler:
-		ch = card_handler_auto(sl, opts.card_handler)
+		ch = CardHandlerAuto(sl, opts.card_handler)
 	else:
-		ch = card_handler(sl)
+		ch = CardHandler(sl)
 
 	# Iterate
 	first = True
diff --git a/pySim-shell.py b/pySim-shell.py
index 7977ff5..5644466 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -40,7 +40,7 @@
 from pySim.cards import card_detect, SimCard
 from pySim.utils import h2b, swap_nibbles, rpad, b2h, h2s, JsonEncoder, bertlv_parse_one
 from pySim.utils import dec_st, sanitize_pin_adm, tabulate_str_list, is_hex, boxed_heading_str
-from pySim.card_handler import card_handler
+from pySim.card_handler import CardHandler
 
 from pySim.filesystem import CardMF, RuntimeState, CardDF, CardADF
 from pySim.ts_51_011 import CardProfileSIM, DF_TELECOM, DF_GSM
@@ -484,7 +484,7 @@
 
 	sl.wait_for_card();
 
-	card_handler = card_handler(sl)
+	card_handler = CardHandler(sl)
 
 	card = card_detect("auto", scc)
 	if card is None:
diff --git a/pySim/card_handler.py b/pySim/card_handler.py
index 9beab51..ef1b071 100644
--- a/pySim/card_handler.py
+++ b/pySim/card_handler.py
@@ -27,7 +27,7 @@
 import yaml
 
 # Manual card handler: User is prompted to insert/remove card from the reader.
-class card_handler:
+class CardHandler:
 
 	sl = None
 
@@ -47,7 +47,7 @@
 		print("")
 
 # Automatic card handler: A machine is used to handle the cards.
-class card_handler_auto:
+class CardHandlerAuto:
 
 	sl = None
 	cmds = None

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/25499
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I4b2c06b1c607c993c9aaf0d57ad2352bb6b36e74
Gerrit-Change-Number: 25499
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210920/bc70630b/attachment.htm>


More information about the gerrit-log mailing list