mirror of
https://github.com/neumond/python-computer-craft.git
synced 2024-05-20 08:03:57 -04:00
Reorganize files
This commit is contained in:
parent
a885b539a0
commit
7d7bac16f3
|
@ -36,7 +36,7 @@ class ModemMixin:
|
|||
return self._call(b'isWireless').take_bool()
|
||||
|
||||
def receive(self, channel: int):
|
||||
from ..subapis.os import captureEvent
|
||||
from ..cc.os import captureEvent
|
||||
|
||||
if self.isOpen(channel):
|
||||
raise Exception('Channel is busy')
|
||||
|
@ -75,5 +75,5 @@ class WiredModemPeripheral(BasePeripheral, ModemMixin):
|
|||
|
||||
def wrapRemote(self, peripheralName: str) -> Optional[BasePeripheral]:
|
||||
# use instead getMethodsRemote and callRemote
|
||||
from ..subapis.peripheral import wrap
|
||||
from ..cc.peripheral import wrap
|
||||
return wrap(peripheralName)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from ..subapis.term import TermMixin
|
||||
from ..cc.term import TermMixin
|
||||
from ._base import BasePeripheral
|
||||
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ class ComputerCraftLoader(Loader):
|
|||
assert sn[0] == 'cc'
|
||||
if len(sn) == 1:
|
||||
sn.append('_pkg')
|
||||
rawmod = import_module('.' + sn[1], 'computercraft.subapis')
|
||||
rawmod = import_module('.' + sn[1], 'computercraft.cc')
|
||||
mod = ModuleType(spec.name)
|
||||
for k in rawmod.__all__:
|
||||
setattr(mod, k, getattr(rawmod, k))
|
||||
|
|
|
@ -115,7 +115,7 @@ def _computer_peri(place_thing, thing):
|
|||
c = peripheral.wrap(side)
|
||||
assert c is not None
|
||||
|
||||
from computercraft.subapis.peripheral import ComputerMixin
|
||||
from computercraft.cc.peripheral import ComputerMixin
|
||||
tbl = get_object_table(f'peripheral.wrap("{side}")')
|
||||
assert get_class_table(ComputerMixin) == tbl
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
raise ValueError
|
|
@ -1 +0,0 @@
|
|||
print('Hello world!')
|
|
@ -1,5 +1,5 @@
|
|||
from computercraft.subapis.peripheral import CCMonitor
|
||||
from computercraft.subapis.mixins import TermMixin
|
||||
from computercraft.cc.peripheral import CCMonitor
|
||||
from computercraft.cc.mixins import TermMixin
|
||||
from cc import import_file, colors, os, peripheral
|
||||
|
||||
_lib = import_file('_lib.py', __file__)
|
||||
|
|
8
setup.py
8
setup.py
|
@ -24,7 +24,13 @@ setup(
|
|||
'Topic :: Games/Entertainment',
|
||||
],
|
||||
keywords='computercraft minecraft',
|
||||
packages=['computercraft', 'computercraft.subapis'],
|
||||
packages=[
|
||||
'computercraft',
|
||||
'computercraft.cc',
|
||||
'computercraft.cc_peripherals',
|
||||
'computercraft.oc',
|
||||
'computercraft.oc_peripherals',
|
||||
],
|
||||
package_data={'computercraft': ['back.lua']},
|
||||
install_requires=['aiohttp', 'greenlet'],
|
||||
entry_points={
|
||||
|
|
|
@ -27,7 +27,9 @@ _proto_folder = (Path(__file__).parent / 'proto')
|
|||
def test_proto(logfile):
|
||||
sbuf = deque()
|
||||
with computercraft.sess.patch_std_files():
|
||||
pgen = computercraft.server.protocol(sbuf.append, oc='_oc' in logfile.name)
|
||||
pgen = computercraft.server.protocol(
|
||||
sbuf.append,
|
||||
oc='/oc_' in str(logfile.relative_to(_proto_folder)))
|
||||
pgen.send(None)
|
||||
|
||||
with logfile.open('rb') as lf:
|
||||
|
|
Loading…
Reference in a new issue