mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-24 06:18:33 +03:00
runtime: rename get_file_for_selectable to get_file_for_filename
Let's rename get_file_for_selectable to get_file_for_filename so that it is immediately clear what the method does. Related: OS#6092 Change-Id: Ifed860814229857ad8b969e50849debbf5d8918f
This commit is contained in:
@@ -401,7 +401,7 @@ class RuntimeLchan:
|
|||||||
(data, _sw) = self.scc.status()
|
(data, _sw) = self.scc.status()
|
||||||
return self.selected_file.decode_select_response(data)
|
return self.selected_file.decode_select_response(data)
|
||||||
|
|
||||||
def get_file_for_selectable(self, name: str):
|
def get_file_for_filename(self, name: str):
|
||||||
"""Get the related CardFile object for a specified filename."""
|
"""Get the related CardFile object for a specified filename."""
|
||||||
sels = self.selected_file.get_selectables()
|
sels = self.selected_file.get_selectables()
|
||||||
return sels[name]
|
return sels[name]
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class Ts102222Commands(CommandSet):
|
|||||||
if not opts.force_delete:
|
if not opts.force_delete:
|
||||||
self._cmd.perror("Refusing to permanently delete the file, please read the help text.")
|
self._cmd.perror("Refusing to permanently delete the file, please read the help text.")
|
||||||
return
|
return
|
||||||
f = self._cmd.lchan.get_file_for_selectable(opts.NAME)
|
f = self._cmd.lchan.get_file_for_filename(opts.NAME)
|
||||||
(_data, _sw) = self._cmd.lchan.scc.delete_file(f.fid)
|
(_data, _sw) = self._cmd.lchan.scc.delete_file(f.fid)
|
||||||
|
|
||||||
def complete_delete_file(self, text, line, begidx, endidx) -> List[str]:
|
def complete_delete_file(self, text, line, begidx, endidx) -> List[str]:
|
||||||
@@ -65,7 +65,7 @@ class Ts102222Commands(CommandSet):
|
|||||||
if not opts.force:
|
if not opts.force:
|
||||||
self._cmd.perror("Refusing to terminate the file, please read the help text.")
|
self._cmd.perror("Refusing to terminate the file, please read the help text.")
|
||||||
return
|
return
|
||||||
f = self._cmd.lchan.get_file_for_selectable(opts.NAME)
|
f = self._cmd.lchan.get_file_for_filename(opts.NAME)
|
||||||
(_data, _sw) = self._cmd.lchan.scc.terminate_df(f.fid)
|
(_data, _sw) = self._cmd.lchan.scc.terminate_df(f.fid)
|
||||||
|
|
||||||
def complete_terminate_df(self, text, line, begidx, endidx) -> List[str]:
|
def complete_terminate_df(self, text, line, begidx, endidx) -> List[str]:
|
||||||
@@ -81,7 +81,7 @@ class Ts102222Commands(CommandSet):
|
|||||||
if not opts.force:
|
if not opts.force:
|
||||||
self._cmd.perror("Refusing to terminate the file, please read the help text.")
|
self._cmd.perror("Refusing to terminate the file, please read the help text.")
|
||||||
return
|
return
|
||||||
f = self._cmd.lchan.get_file_for_selectable(opts.NAME)
|
f = self._cmd.lchan.get_file_for_filename(opts.NAME)
|
||||||
(_data, _sw) = self._cmd.lchan.scc.terminate_ef(f.fid)
|
(_data, _sw) = self._cmd.lchan.scc.terminate_ef(f.fid)
|
||||||
|
|
||||||
def complete_terminate_ef(self, text, line, begidx, endidx) -> List[str]:
|
def complete_terminate_ef(self, text, line, begidx, endidx) -> List[str]:
|
||||||
@@ -209,7 +209,7 @@ class Ts102222Commands(CommandSet):
|
|||||||
@cmd2.with_argparser(resize_ef_parser)
|
@cmd2.with_argparser(resize_ef_parser)
|
||||||
def do_resize_ef(self, opts):
|
def do_resize_ef(self, opts):
|
||||||
"""Resize an existing EF below the currently selected DF. Requires related privileges."""
|
"""Resize an existing EF below the currently selected DF. Requires related privileges."""
|
||||||
f = self._cmd.lchan.get_file_for_selectable(opts.NAME)
|
f = self._cmd.lchan.get_file_for_filename(opts.NAME)
|
||||||
ies = [FileIdentifier(decoded=f.fid),
|
ies = [FileIdentifier(decoded=f.fid),
|
||||||
FileSize(decoded=opts.file_size)]
|
FileSize(decoded=opts.file_size)]
|
||||||
fcp = FcpTemplate(children=ies)
|
fcp = FcpTemplate(children=ies)
|
||||||
|
|||||||
Reference in New Issue
Block a user