Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lwc
/
compare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
938ddf74
authored
6 years ago
by
Enrico Pozzobon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
middleware stub for uno
parent
726359a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
templates/uno/test
+24
-0
test.py
+3
-0
No files found.
templates/uno/test
0 → 100755
View file @
938ddf74
#!/usr/bin/env python3
import
os
import
sys
import
subprocess
def
flash
():
pipe
=
subprocess
.
PIPE
p
=
subprocess
.
Popen
([
'platformio'
,
'run'
,
'-e'
,
'uno'
,
'--target'
,
'upload'
],
stdout
=
sys
.
stderr
,
stdin
=
pipe
)
stdout
,
stderr
=
p
.
communicate
(
""
)
def
main
(
argv
):
print
(
argv
[
0
],
file
=
sys
.
stderr
)
script_dir
=
os
.
path
.
split
(
argv
[
0
])[
0
]
if
len
(
script_dir
)
>
0
:
os
.
chdir
(
script_dir
)
flash
()
return
0
;
if
__name__
==
"__main__"
:
sys
.
exit
(
main
(
sys
.
argv
))
This diff is collapsed.
Click to expand it.
test.py
View file @
938ddf74
...
@@ -23,6 +23,9 @@ def main(argv):
...
@@ -23,6 +23,9 @@ def main(argv):
def
read
(
l
):
def
read
(
l
):
data
=
p
.
stdout
.
read
(
l
)
data
=
p
.
stdout
.
read
(
l
)
if
len
(
data
)
==
0
:
print
(
"Unexpected end of stream"
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
if
len
(
data
)
!=
l
:
if
len
(
data
)
!=
l
:
raise
Exception
(
"could not read
%
d bytes of data (got
%
d)"
%
(
l
,
len
(
data
)))
raise
Exception
(
"could not read
%
d bytes of data (got
%
d)"
%
(
l
,
len
(
data
)))
return
data
return
data
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment