Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions jupyter_micropython_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import logging, sys, time, os, re
import serial, socket, serial.tools.list_ports, select
import websocket # only for WebSocketConnectionClosedException
import mpy_cross
from glob import glob
from . import deviceconnector

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -231,13 +233,11 @@ def interpretpercentline(self, percentline, cellcontents):
if apargs and apargs.set_exe:
self.mpycrossexe = apargs.set_exe
elif apargs.pyfile:
if self.mpycrossexe:
self.dc.mpycross(self.mpycrossexe, apargs.pyfile)
else:
self.sres("Cross compiler executable not yet set\n", 31)
self.sres("try: %mpy-cross --set-exe /home/julian/extrepositories/micropython/mpy-cross/mpy-cross\n")
if self.mpycrossexe:
self.mpycrossexe = "/home/julian/extrepositories/micropython/mpy-cross/mpy-cross"
if not self.mpycrossexe:
self.mpycrossexe = mpy_cross.mpy_cross

for pyfile in glob(apargs.pyfile):
self.dc.mpycross(self.mpycrossexe, pyfile)
else:
self.sres(ap_mpycross.format_help())
return cellcontents.strip() and cellcontents or None
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
url='https://github.com/goatchurchprime/jupyter_micropython_kernel',
license='GPL3',
packages=['jupyter_micropython_kernel'],
install_requires=['pyserial>=3.4', 'websocket-client>=0.44']
install_requires=['pyserial>=3.4', 'websocket-client>=0.44', 'mpy-cross']
)