Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
6dfbb39f
Commit
6dfbb39f
authored
May 21, 2018
by
Bob Kuhn
Committed by
Scott Lahteine
May 21, 2018
Browse files
Options
Downloads
Patches
Plain Diff
[LPC1768] Add error-handling to upload script, update autobuild.py (#10802)
parent
68d7fcec
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+31
-13
31 additions, 13 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
buildroot/share/atom/auto_build.py
+67
-46
67 additions, 46 deletions
buildroot/share/atom/auto_build.py
with
98 additions
and
59 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+
31
−
13
View file @
6dfbb39f
...
@@ -34,6 +34,7 @@ if current_OS == 'Windows':
...
@@ -34,6 +34,7 @@ if current_OS == 'Windows':
#
#
import
os
import
os
upload_disk
=
'
Disk not found
'
target_file_found
=
False
target_file_found
=
False
target_drive_found
=
False
target_drive_found
=
False
for
drive
in
drives
:
for
drive
in
drives
:
...
@@ -66,7 +67,9 @@ if current_OS == 'Windows':
...
@@ -66,7 +67,9 @@ if current_OS == 'Windows':
env
.
Replace
(
env
.
Replace
(
UPLOAD_PORT
=
upload_disk
UPLOAD_PORT
=
upload_disk
)
)
print
'
upload disk:
'
,
upload_disk
else
:
print
'
\n
Unable to find destination disk. File must be copied manually.
\n
'
if
current_OS
==
'
Linux
'
:
if
current_OS
==
'
Linux
'
:
...
@@ -76,6 +79,7 @@ if current_OS == 'Linux':
...
@@ -76,6 +79,7 @@ if current_OS == 'Linux':
#
#
import
os
import
os
upload_disk
=
'
Disk not found
'
target_file_found
=
False
target_file_found
=
False
target_drive_found
=
False
target_drive_found
=
False
medias
=
os
.
listdir
(
'
/media
'
)
#
medias
=
os
.
listdir
(
'
/media
'
)
#
...
@@ -85,7 +89,11 @@ if current_OS == 'Linux':
...
@@ -85,7 +89,11 @@ if current_OS == 'Linux':
target_drive_found
=
True
target_drive_found
=
True
upload_disk
=
'
/media/
'
+
media
+
'
/
'
+
target_drive
+
'
/
'
upload_disk
=
'
/media/
'
+
media
+
'
/
'
+
target_drive
+
'
/
'
for
drive
in
drives
:
for
drive
in
drives
:
files
=
os
.
listdir
(
'
/media/
'
+
media
+
'
/
'
+
drive
)
#
try
:
files
=
os
.
listdir
(
'
/media/
'
+
media
+
'
/
'
+
drive
)
except
:
continue
else
:
if
target_filename
in
files
:
if
target_filename
in
files
:
if
target_file_found
==
False
:
if
target_file_found
==
False
:
upload_disk
=
'
/media/
'
+
media
+
'
/
'
+
drive
+
'
/
'
upload_disk
=
'
/media/
'
+
media
+
'
/
'
+
drive
+
'
/
'
...
@@ -101,6 +109,9 @@ if current_OS == 'Linux':
...
@@ -101,6 +109,9 @@ if current_OS == 'Linux':
UPLOAD_FLAGS
=
"
-P$UPLOAD_PORT
"
,
UPLOAD_FLAGS
=
"
-P$UPLOAD_PORT
"
,
UPLOAD_PORT
=
upload_disk
UPLOAD_PORT
=
upload_disk
)
)
print
'
upload disk:
'
,
upload_disk
else
:
print
'
\n
Unable to find destination disk. File must be copied manually.
\n
'
if
current_OS
==
'
Darwin
'
:
# MAC
if
current_OS
==
'
Darwin
'
:
# MAC
...
@@ -110,15 +121,19 @@ if current_OS == 'Darwin': # MAC
...
@@ -110,15 +121,19 @@ if current_OS == 'Darwin': # MAC
#
#
import
os
import
os
upload_disk
=
'
Disk not found
'
drives
=
os
.
listdir
(
'
/Volumes
'
)
# human readable names
drives
=
os
.
listdir
(
'
/Volumes
'
)
# human readable names
target_file_found
=
False
target_file_found
=
False
target_drive_found
=
False
target_drive_found
=
False
if
target_drive
in
drives
and
target_file_found
==
False
:
# set upload if not found target file yet
if
target_drive
in
drives
and
target_file_found
==
False
:
# set upload if not found target file yet
target_drive_found
=
True
target_drive_found
=
True
upload_disk
=
'
/Volumes/
'
+
drive
+
'
/
'
upload_disk
=
'
/Volumes/
'
+
target_
drive
+
'
/
'
for
drive
in
drives
:
for
drive
in
drives
:
target_file_found
=
True
try
:
filenames
=
os
.
listdir
(
'
/Volumes/
'
+
drive
+
'
/
'
)
filenames
=
os
.
listdir
(
'
/Volumes/
'
+
drive
+
'
/
'
)
# will get an error if the drive is protected
except
:
continue
else
:
if
target_filename
in
filenames
:
if
target_filename
in
filenames
:
if
target_file_found
==
False
:
if
target_file_found
==
False
:
upload_disk
=
'
/Volumes/
'
+
drive
+
'
/
'
upload_disk
=
'
/Volumes/
'
+
drive
+
'
/
'
...
@@ -132,3 +147,6 @@ if current_OS == 'Darwin': # MAC
...
@@ -132,3 +147,6 @@ if current_OS == 'Darwin': # MAC
env
.
Replace
(
env
.
Replace
(
UPLOAD_PORT
=
upload_disk
UPLOAD_PORT
=
upload_disk
)
)
print
'
\n
upload disk:
'
,
upload_disk
,
'
\n
'
else
:
print
'
\n
Unable to find destination disk. File must be copied manually.
\n
'
This diff is collapsed.
Click to expand it.
buildroot/share/atom/auto_build.py
+
67
−
46
View file @
6dfbb39f
...
@@ -204,7 +204,7 @@ def resolve_path(path):
...
@@ -204,7 +204,7 @@ def resolve_path(path):
#get line and column numbers
#get line and column numbers
line_num
=
1
line_num
=
1
column_num
=
1
column_num
=
1
line_start
=
path
.
find
(
'
:
'
)
line_start
=
path
.
find
(
'
:
'
,
2
)
# use 2 here so don't eat Windows full path
column_start
=
path
.
find
(
'
:
'
,
line_start
+
1
)
column_start
=
path
.
find
(
'
:
'
,
line_start
+
1
)
if
column_start
==
-
1
:
if
column_start
==
-
1
:
column_start
=
len
(
path
)
column_start
=
len
(
path
)
...
@@ -218,12 +218,24 @@ def resolve_path(path):
...
@@ -218,12 +218,24 @@ def resolve_path(path):
if
not
(
column_start
==
column_end
):
if
not
(
column_start
==
column_end
):
column_num
=
path
[
column_start
+
1
:
column_end
]
column_num
=
path
[
column_start
+
1
:
column_end
]
if
column_num
==
''
:
if
column_num
==
''
:
column_num
=
1
column_num
=
0
index_end
=
path
.
find
(
'
,
'
)
if
0
<=
index_end
:
path
=
path
[
:
index_end
]
# delete comma and anything after
index_end
=
path
.
find
(
'
:
'
,
2
)
if
0
<=
index_end
:
path
=
path
[
:
path
.
find
(
'
:
'
,
2
)]
# delete the line number and anything after
path
=
path
[
:
path
.
find
(
'
:
'
)]
# delete the line number and anything after
path
=
path
.
replace
(
'
\\
'
,
'
/
'
)
path
=
path
.
replace
(
'
\\
'
,
'
/
'
)
if
1
==
path
.
find
(
'
:
'
)
and
current_OS
==
'
Windows
'
:
return
path
,
line_num
,
column_num
# found a full path - no need for further processing
elif
0
==
path
.
find
(
'
/
'
)
and
(
current_OS
==
'
Linux
'
or
current_OS
==
'
Darwin
'
):
return
path
,
line_num
,
column_num
# found a full path - no need for further processing
else
:
# resolve as many '../' as we can
# resolve as many '../' as we can
while
0
<=
path
.
find
(
'
../
'
):
while
0
<=
path
.
find
(
'
../
'
):
end
=
path
.
find
(
'
../
'
)
-
1
end
=
path
.
find
(
'
../
'
)
-
1
...
@@ -324,6 +336,9 @@ def open_file(path):
...
@@ -324,6 +336,9 @@ def open_file(path):
elif
current_OS
==
'
Linux
'
:
elif
current_OS
==
'
Linux
'
:
command
=
file_path
+
'
:
'
+
str
(
line_num
)
+
'
:
'
+
str
(
column_num
)
command
=
file_path
+
'
:
'
+
str
(
line_num
)
+
'
:
'
+
str
(
column_num
)
index_end
=
command
.
find
(
'
,
'
)
if
0
<=
index_end
:
command
=
command
[
:
index_end
]
# sometimes a comma magically appears, don't want it
running_apps
=
subprocess
.
Popen
(
'
ps ax -o cmd
'
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
)
running_apps
=
subprocess
.
Popen
(
'
ps ax -o cmd
'
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
)
(
output
,
err
)
=
running_apps
.
communicate
()
(
output
,
err
)
=
running_apps
.
communicate
()
temp
=
output
.
split
(
'
\n
'
)
temp
=
output
.
split
(
'
\n
'
)
...
@@ -336,7 +351,7 @@ def open_file(path):
...
@@ -336,7 +351,7 @@ def open_file(path):
return
False
,
''
return
False
,
''
(
success_sublime
,
editor_path_sublime
)
=
find_editor_linux
(
'
sublime_text
'
,
temp
)
(
success_sublime
,
editor_path_sublime
)
=
find_editor_linux
(
'
sublime_text
'
,
temp
)
(
success_atom
,
editor_path_atom
)
=
find_editor
+
linux
(
'
atom
'
,
temp
)
(
success_atom
,
editor_path_atom
)
=
find_editor
_
linux
(
'
atom
'
,
temp
)
if
success_sublime
:
if
success_sublime
:
subprocess
.
Popen
([
editor_path_sublime
,
command
])
subprocess
.
Popen
([
editor_path_sublime
,
command
])
...
@@ -350,6 +365,9 @@ def open_file(path):
...
@@ -350,6 +365,9 @@ def open_file(path):
elif
current_OS
==
'
Darwin
'
:
# MAC
elif
current_OS
==
'
Darwin
'
:
# MAC
command
=
file_path
+
'
:
'
+
str
(
line_num
)
+
'
:
'
+
str
(
column_num
)
command
=
file_path
+
'
:
'
+
str
(
line_num
)
+
'
:
'
+
str
(
column_num
)
index_end
=
command
.
find
(
'
,
'
)
if
0
<=
index_end
:
command
=
command
[
:
index_end
]
# sometimes a comma magically appears, don't want it
running_apps
=
subprocess
.
Popen
(
'
ps axwww -o command
'
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
)
running_apps
=
subprocess
.
Popen
(
'
ps axwww -o command
'
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
)
(
output
,
err
)
=
running_apps
.
communicate
()
(
output
,
err
)
=
running_apps
.
communicate
()
temp
=
output
.
split
(
'
\n
'
)
temp
=
output
.
split
(
'
\n
'
)
...
@@ -424,8 +442,11 @@ def get_build_last():
...
@@ -424,8 +442,11 @@ def get_build_last():
date_last
=
0.0
date_last
=
0.0
DIR__pioenvs
=
os
.
listdir
(
'
.pioenvs
'
)
DIR__pioenvs
=
os
.
listdir
(
'
.pioenvs
'
)
for
name
in
DIR__pioenvs
:
for
name
in
DIR__pioenvs
:
if
0
<=
name
.
find
(
'
.
'
)
or
0
<=
name
.
find
(
'
-
'
):
# skip files in listing
continue
DIR_temp
=
os
.
listdir
(
'
.pioenvs/
'
+
name
)
DIR_temp
=
os
.
listdir
(
'
.pioenvs/
'
+
name
)
for
names_temp
in
DIR_temp
:
for
names_temp
in
DIR_temp
:
if
0
==
names_temp
.
find
(
'
firmware.
'
):
if
0
==
names_temp
.
find
(
'
firmware.
'
):
date_temp
=
os
.
path
.
getmtime
(
'
.pioenvs/
'
+
name
+
'
/
'
+
names_temp
)
date_temp
=
os
.
path
.
getmtime
(
'
.pioenvs/
'
+
name
+
'
/
'
+
names_temp
)
if
date_temp
>
date_last
:
if
date_temp
>
date_last
:
...
@@ -941,7 +962,7 @@ class output_window(Text):
...
@@ -941,7 +962,7 @@ class output_window(Text):
Text
.
__init__
(
self
,
self
.
frame
,
borderwidth
=
3
,
relief
=
"
sunken
"
)
Text
.
__init__
(
self
,
self
.
frame
,
borderwidth
=
3
,
relief
=
"
sunken
"
)
self
.
config
(
tabs
=
(
400
,))
# configure Text widget tab stops
self
.
config
(
tabs
=
(
400
,))
# configure Text widget tab stops
self
.
config
(
background
=
'
black
'
,
foreground
=
'
white
'
,
font
=
(
"
consolas
"
,
12
),
wrap
=
'
word
'
,
undo
=
'
True
'
)
self
.
config
(
background
=
'
black
'
,
foreground
=
'
white
'
,
font
=
(
"
consolas
"
,
12
),
wrap
=
'
word
'
,
undo
=
'
True
'
)
self
.
config
(
height
=
24
,
width
=
1
2
0
)
self
.
config
(
height
=
24
,
width
=
1
0
0
)
self
.
config
(
insertbackground
=
'
pale green
'
)
# keyboard insertion point
self
.
config
(
insertbackground
=
'
pale green
'
)
# keyboard insertion point
self
.
pack
(
side
=
'
left
'
,
fill
=
'
both
'
,
expand
=
True
)
self
.
pack
(
side
=
'
left
'
,
fill
=
'
both
'
,
expand
=
True
)
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment