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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
e2db509d
Commit
e2db509d
authored
6 years ago
by
Bob Kuhn
Committed by
Scott Lahteine
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[2.0.x] Update/Fix LPC1768 extra script upload_extra_script.py (#10843)
* Use a different method to find the volume info in Windows
parent
7261f488
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+23
-4
23 additions, 4 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
with
23 additions
and
4 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+
23
−
4
View file @
e2db509d
...
...
@@ -8,6 +8,21 @@ target_filename = "FIRMWARE.CUR"
target_drive
=
"
REARM
"
upload_disk
=
""
import
os
import
subprocess
#env_vars = subprocess.check_output('platformio run -t envdump')
#env_vars = env_vars.split('\n')
#for env in env_vars:
# print env
#exit(0)
build_type
=
os
.
environ
.
get
(
"
BUILD_TYPE
"
,
'
Not Set
'
)
if
not
(
build_type
==
'
upload
'
or
build_type
==
'
traceback
'
or
build_type
==
'
Not Set
'
)
:
exit
(
0
)
print
'
\n
Searching for upload disk
'
import
platform
current_OS
=
platform
.
system
()
...
...
@@ -37,6 +52,14 @@ if current_OS == 'Windows':
upload_disk
=
'
Disk not found
'
target_file_found
=
False
target_drive_found
=
False
volume_info
=
subprocess
.
check_output
(
'
powershell -Command volume
'
)
volume_info
=
volume_info
.
split
(
'
\n
'
)
for
entry
in
volume_info
:
if
target_drive
in
entry
and
target_drive_found
==
False
:
# set upload if not found target file yet
target_drive_found
=
True
upload_disk
=
entry
[
:
entry
.
find
(
'
'
)]
+
'
:
'
for
drive
in
drives
:
final_drive_name
=
drive
.
strip
().
rstrip
(
'
\\
'
)
# typical result (string): 'C:'
# modified version of walklevel()
...
...
@@ -49,10 +72,6 @@ if current_OS == 'Windows':
num_sep_this
=
root
.
count
(
os
.
path
.
sep
)
if
num_sep
+
level
<=
num_sep_this
:
del
dirs
[:]
volume_info
=
subprocess
.
check_output
(
'
fsutil fsinfo volumeinfo
'
+
final_drive_name
)
if
target_drive
in
volume_info
and
target_file_found
==
False
:
# set upload if not found target file yet
target_drive_found
=
True
upload_disk
=
root
if
target_filename
in
files
:
if
target_file_found
==
False
:
upload_disk
=
root
...
...
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