Esempio n. 1
0
def __system__():
    print("succes starting...")
    import sys

    try:
        import jnupy
    except ImportError:
        sys.exit("error: program must launch by jnupy")

    try:
        __path__ = __file__.rpartition("/")[0]
        sys.path.append(__path__)
        sys.path.append(__path__ + "/oclib")
        sys.path.append(__path__ + "/pylib")

        battery = jnupy.getenv("MICROPYTHON_BATTERY")
        assert battery or MICROPYTHON_BATTERY
        sys.path.append(battery or MICROPYTHON_BATTERY)

        try:
            import oc
            oc.fake = False
        except ImportError:
            sys.path.append(__path__ + "/__fake__")
            import oc
            oc.fake = True

        import bios
        from bios import kernel

        if oc.fake:
            bios.main()

        return kernel
    except SystemExit:
        raise
    except BaseException as e:
        sys.print_exception(e)
        raise
Esempio n. 2
0
File: bios.py Progetto: EcmaXp/mpoc
import sys
from sys import exit
import jnupy

# TODO: move bios.py to micropython/opencom/main.py
__path__ = __file__.rpartition("/")[0]
sys.path.extend([
    ".",
    __path__,
    __path__ + "/oclib",
    __path__ + "/pylib",
    jnupy.getenv("MPOC_ROM"),
    jnupy.getenv("MICROPYTHON_BATTERY"),
])

import utime
import microthread

import jnupy

import utime

from taskmgr import *
import taskmgr

from opencom import syscall

def hello(t:int) -> int:
    pass

print(hello)