File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [ Unreleased]
8
8
9
+ ### Changed
10
+ - Changed EV3 script runner to just copy the script instead of replicating
11
+ the local directory structure on the brick.
12
+
9
13
## [ 1.0.0-alpha.35] - 2023-02-10
10
14
11
15
### Added
Original file line number Diff line number Diff line change 2
2
# Copyright (c) 2021-2022 The Pybricks Authors
3
3
4
4
import asyncio
5
- import os
6
-
7
5
import asyncssh
6
+ import os
7
+ import pathlib
8
8
9
9
10
10
class EV3Connection :
@@ -56,23 +56,10 @@ async def download(self, local_path):
56
56
Arguments:
57
57
local_path (str):
58
58
Path to the file to be downloaded. Relative to current working
59
- directory. This same tree will be created on the EV3 if it
60
- does not already exist.
59
+ directory.
61
60
"""
62
- # Compute paths
63
- dirs , file_name = os .path .split (local_path )
64
-
65
- # Make sure same directory structure exists on EV3
66
- if not await self .client .sftp .exists (self .abs_path (dirs )):
67
- # If not, make the folders one by one
68
- total = ""
69
- for name in dirs .split (os .sep ):
70
- total = os .path .join (total , name )
71
- if not await self .client .sftp .exists (self .abs_path (total )):
72
- await self .client .sftp .mkdir (self .abs_path (total ))
73
-
74
61
# Send script to EV3
75
- remote_path = self .abs_path (local_path )
62
+ remote_path = self .abs_path (pathlib . Path ( local_path ). name )
76
63
await self .client .sftp .put (local_path , remote_path )
77
64
return remote_path
78
65
You can’t perform that action at this time.
0 commit comments