Skip to content

Commit 8b65d59

Browse files
authored
Merge pull request #21 from arduino/develop
Product name change and bugfixes
2 parents 05df9e7 + d5f18bb commit 8b65d59

File tree

12 files changed

+66
-4880
lines changed

12 files changed

+66
-4880
lines changed

README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,5 @@ Some changes on the Electron code will require reopening the app but all UI chan
8181

8282
## Disclaimer
8383

84-
This software is provided “as is” and we make no express or implied warranties whatsoever with respect to its functionality,
85-
operability, or use, including, without limitation, any implied warranties of merchantability, fitness for a particular purpose,
86-
or infringement. We expressly disclaim any liability whatsoever for any direct, indirect, consequential, incidental or special damages,
87-
including, without limitation, lost revenues, lost profits, losses resulting from business interruption or loss of data,
88-
regardless of the form of action or legal theory under which the liability may be asserted, even if advised of the possibility
89-
or likelihood of such damages.
84+
This software is provided “as is” and we make no express or implied warranties whatsoever with respect to its functionality, operability, or use, including, without limitation, any implied warranties of merchantability, fitness for a particular purpose, or infringement. We expressly disclaim any liability whatsoever for any direct, indirect, consequential, incidental or special damages, including, without limitation, lost revenues, lost profits, losses resulting from business interruption or loss of data, regardless of the form of action or legal theory under which the liability may be asserted, even if advised of the possibility or likelihood of such damages.
9085

index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const { app, BrowserWindow, Menu, ipcMain, dialog } = require('electron')
22
const path = require('path')
33
const fs = require('fs')
4-
const join = require('path').join
54
const openAboutWindow = require('about-window').default
65

76
let win = null // main window
@@ -20,6 +19,8 @@ function listFolder(folder) {
2019
let filePath = path.resolve(folder, f)
2120
return !fs.lstatSync(filePath).isDirectory()
2221
})
22+
// Filter out dot files
23+
files = files.filter(f => f.indexOf('.') !== 0)
2324
return files
2425
}
2526

@@ -160,7 +161,7 @@ const template = [
160161
{ role: 'togglefullscreen' },
161162
...(isDev ? [
162163
{ type: 'separator' },
163-
{ role: 'toggleDevTools' },
164+
{ role: 'toggleDevTools' },
164165
]:[
165166
])
166167
]
@@ -201,8 +202,8 @@ const template = [
201202
label:'Info about this app',
202203
click: () => {
203204
openAboutWindow({
204-
icon_path: join(__dirname, 'ui/arduino/assets/about_image.png'),
205-
css_path: join(__dirname, 'ui/arduino/about.css'),
205+
icon_path: path.join(__dirname, 'ui/arduino/assets/about_image.png'),
206+
css_path: path.join(__dirname, 'ui/arduino/about.css'),
206207
copyright: '© Arduino SA 2022',
207208
package_json_dir: __dirname,
208209
bug_report_url: "https://github.com/arduino/lab-micropython-editor/issues",

micropython.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ function sleep(millis) {
1111
})
1212
}
1313

14+
function escape_string(string) {
15+
string = string.replace(/"""/g, `\\"\\"\\"`)
16+
string = string.replace(/\'/g, `\\'`)
17+
string = string.replace(/\"/g, `\\"`)
18+
return string
19+
}
20+
1421
class MicroPythonBoard {
1522
constructor() {
1623
this.device = null
@@ -221,7 +228,7 @@ class MicroPythonBoard {
221228
for (let i = 0; i < content.length; i+=128) {
222229
let slice = content.slice(i, i+128)
223230
slice = slice.toString()
224-
slice = slice.replace(/"""/g, `\\"\\"\\"`)
231+
slice = escape_string(slice)
225232
await this.serial.write(`w("""${slice}""")`)
226233
await this.serial.write(`\x04`)
227234
await sleep(100)
@@ -243,8 +250,7 @@ class MicroPythonBoard {
243250
for (let i = 0; i < content.length; i+=64) {
244251
let slice = content.slice(i, i+64)
245252
slice = slice.toString()
246-
slice = slice.replace(/"""/g, `\\"\\"\\"`)
247-
// slice = slice.replace(//g, ``)
253+
slice = escape_string(slice)
248254
await this.serial.write(`w("""${slice}""")\n`)
249255
await this.serial.write(`\x04`)
250256
await sleep(50)

0 commit comments

Comments
 (0)