Skip to content

Commit 96f445c

Browse files
committed
Remove commands.exec in favor of commands.execAsync
1 parent 4746661 commit 96f445c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

computercraft/subapis/commands.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Tuple, List, Optional
22

33
from .base import BaseSubAPI
4-
from ..rproc import tuple3_integer, any_dict, any_list, array_string, integer, fact_tuple, boolean, option_integer
4+
from ..rproc import tuple3_integer, any_dict, any_list, array_string, fact_tuple, boolean, option_integer
55

66

77
command_result = fact_tuple(boolean, array_string, option_integer, tail_nils=1)
@@ -11,9 +11,6 @@ class CommandsAPI(BaseSubAPI):
1111
async def exec(self, command: str) -> Tuple[bool, List[str], Optional[int]]:
1212
return command_result(await self._send('exec', command))
1313

14-
async def execAsync(self, command: str) -> int:
15-
return integer(await self._send('execAsync', command))
16-
1714
async def list(self) -> List[str]:
1815
return array_string(await self._send('list'))
1916

testmod.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ async def test_disk_api(api):
232232

233233

234234
async def test_commands_api(api):
235-
assert get_class_table(api.commands.__class__) \
236-
== await get_object_table(api, 'commands.native')
235+
tbl = await get_object_table(api, 'commands.native')
236+
# remove in favor of exec
237+
del tbl['function']['execAsync']
238+
assert get_class_table(api.commands.__class__) == tbl
237239

238240
xyz = await api.commands.getBlockPosition()
239241

0 commit comments

Comments
 (0)