Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable tutorials on Windows #259

Draft
wants to merge 50 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f456afb
- Initial enablement of RefPort and VarPorts
PhilippPlank Nov 12, 2021
2d0ec74
- Initial enablement of RefPort and VarPorts
PhilippPlank Nov 12, 2021
25a3a68
- Initial enablement of RefPort and VarPorts
PhilippPlank Nov 12, 2021
a2d1765
- Initial enablement of RefPort and VarPorts
PhilippPlank Nov 12, 2021
74dfdf6
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 15, 2021
1daa9af
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank Nov 16, 2021
5908401
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank Nov 16, 2021
3df2847
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank Nov 16, 2021
9581fae
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 16, 2021
6e4716a
- Enablement of RefPorts and VarPorts - addressed change requests fro…
PhilippPlank Nov 16, 2021
e22def6
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 17, 2021
bd25a80
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 17, 2021
7edeb1f
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 18, 2021
23fb8d7
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 18, 2021
f6686b4
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 23, 2021
86867c2
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 23, 2021
859a195
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 24, 2021
f7007f8
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 25, 2021
0163202
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 25, 2021
bf934ef
modified connection tutorial for release 0.2.0
PhilippPlank Nov 26, 2021
0eef67e
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 26, 2021
f08a35c
fixed typos
PhilippPlank Nov 26, 2021
ceddf2a
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 26, 2021
f798b0a
Merge branch 'lava-nc:main' into main
PhilippPlank Nov 30, 2021
b6e72bb
Merge branch 'lava-nc:main' into main
PhilippPlank Dec 1, 2021
9c57309
Merge branch 'lava-nc:main' into main
PhilippPlank Dec 3, 2021
7425f7e
Merge branch 'lava-nc:main' into main
PhilippPlank Dec 6, 2021
bc353c7
Merge branch 'lava-nc:main' into main
PhilippPlank Jan 27, 2022
73288a4
Merge branch 'lava-nc:main' into main
PhilippPlank Jan 31, 2022
3f5c2d7
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 9, 2022
e691b1d
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 10, 2022
9ab9a5d
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 10, 2022
a1f0367
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 16, 2022
50f9113
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 16, 2022
e2342f5
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 24, 2022
0b7cedb
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 24, 2022
6a30ad7
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 25, 2022
8e652bc
Merge branch 'lava-nc:main' into main
PhilippPlank Feb 25, 2022
3b3cc6f
Merge branch 'lava-nc:main' into main
PhilippPlank Mar 2, 2022
46b54ad
Merge branch 'lava-nc:main' into main
PhilippPlank Mar 3, 2022
0c02489
Merge branch 'lava-nc:main' into main
PhilippPlank Mar 4, 2022
01d9097
Merge branch 'lava-nc:main' into main
PhilippPlank Mar 11, 2022
efc0bd4
Merge branch 'lava-nc:main' into main
PhilippPlank Mar 16, 2022
976c5d2
Merge branch 'lava-nc:main' into main
PhilippPlank Jun 9, 2022
e4c54c2
Merge branch 'lava-nc:main' into main
PhilippPlank Jun 11, 2022
f881ef2
Merge branch 'lava-nc:main' into tutorial_win_fix
PhilippPlank Jun 14, 2022
be9aa26
Windows fix for tutorials - draft
PhilippPlank Jun 14, 2022
b89d6f1
moved win_exec.py to utils and changed text
weidel-p Jun 16, 2022
b397080
used magic to export single cells instead of complete script
weidel-p Jun 16, 2022
771ae85
lint
weidel-p Jun 27, 2022
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
32 changes: 32 additions & 0 deletions src/lava/utils/win_exec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
# See: https://spdx.org/licenses/

from sys import platform
try:
from IPython import get_ipython
except ModuleNotFoundError:
pass


def export(filename, cell):
'''Exports the cell to the given file name if system is windows.'''
if platform == "win32" or platform == "cygwin":
with open(f"{filename}.py", "a") as f:
f.write(cell)
else:
get_ipython().ex(cell)


def load_ipython_extension(shell):
'''Registers the magic function when the extension loads.'''
shell.register_magic_function(export, 'cell')


def unload_ipython_extension(shell):
'''Unregisters the magic function when the extension unloads.'''
del shell.magics_manager.magics['cell']['export']


if __name__ == "__main__":
pass
Loading