Skip to content

Commit 66dcd88

Browse files
Merge branch 'next-staging' into next
2 parents 6f4d129 + bc316eb commit 66dcd88

File tree

8 files changed

+99
-17
lines changed

8 files changed

+99
-17
lines changed

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

RELEASE_NOTES_2.22.0.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Release notes for Pymakr v2.22.0
2+
3+
It's been a long time coming but we're delighted to finally announce the next release of our Pymakr 2. We've packed this release with tons of new features and bugfixes to make Pymakr 2 even faster, easier and more reliable than ever.
4+
5+
We aim to make your experience with Pymakr as pleasant as possible Should you have any problems with our new release, please [open an issue](https://github.com/pycom/pymakr-vsc/issues/new/choose) on Github so that we can help.
6+
7+
# <br>
8+
9+
## Feature Highlights
10+
11+
[Get Started Guide](#get-started-guide)
12+
13+
[Developer Mode](#developer-mode)
14+
15+
[Device Configuration](#device-configuration)
16+
17+
[Better Notifications](#better-notifications)
18+
19+
[Device Hover](#device-hover)
20+
21+
[Open File on Device](#open-file-on-device)
22+
23+
# <br>
24+
25+
## Get Started Guide
26+
27+
Clicking `ctrl/cmd + shift + p`, typing `walkthrough` and selecting `Get Started: Open Walkthrough...` will show a list of walkthroughs.
28+
29+
Here's you can click `Pymakr 2 - Getting Started` for a brief rundown.
30+
31+
# <br>
32+
33+
## Developer Mode
34+
35+
Dev mode keeps your connected devices running and synchronized to your project folder in realtime.
36+
37+
In dev mode, whenever a file in a project is saved, the changes are synced to the project's devices and the devices then restarted.
38+
39+
Clicking the upload button while in dev mode will stop the current running script and upload files that are different from those on the device. Kinda like patching. _This is different from the regular upload functionality, which erases all content on the device before uploading the entire project._
40+
41+
_Note: Dev mode is limited to to the capabilities of the connected devices. Eg. it's not possible for Pymakr to communicate with a device in `machine.deepsleep` since the device's USB is disabled in this state. (A workaround for this may be possible - see `dev.simulateDeepSleep` in `pymakr.conf`)_
42+
43+
# <br>
44+
45+
## Device Configuration
46+
47+
It's now possible to configure individual devices in `settings->pymakr->devices->configs`. Here you can customize settings like `device.rootPath` and `device.adapterOptions` in case your device doesn't work with the defaults / auto detected values.
48+
49+
# <br>
50+
51+
## Better Notifications
52+
53+
We've added more notifications to help explain the different events and actions in Pymakr.
54+
Power users who are ready to kick the support wheels can click `Don't show again` or save their choices when a popup is no longer wanted.
55+
56+
_Popup choices can be undone in `Settings->Pymakr->Misc->Notifications_
57+
58+
# <br>
59+
60+
## Device hover
61+
62+
Hovering over a device now shows information about the device.
63+
64+
# <br>
65+
66+
## Open File on Device
67+
68+
Right clicking a project file and selecting `Pymakr->Open file on device` will open the corresponding file on the device. Here you can verify the content and save changes as required.

src/Device.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class Device {
196196
}
197197
});
198198
// resetting the device should also reset the waiting calls
199-
[...this.adapter.__proxyMeta.history].pop().promise.finally(() => this.adapter.__proxyMeta.reset());
199+
() => this.adapter.__proxyMeta.reset();
200200
this.log.info("send \\x06 (safeboot)");
201201
this.adapter.sendData("\x06"); // safeboot
202202
});

src/PyMakr.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class PyMakr {
3030
* @param {vscode.ExtensionContext} context
3131
*/
3232
constructor(context) {
33+
this.context = context;
34+
3335
/**
3436
* Actions to be run at the launch of the plugin
3537
* @example
@@ -47,7 +49,7 @@ class PyMakr {
4749
this.vscodeHelpers = createVSCodeHelpers(this);
4850

4951
/** Handles all info, warn and error notifications */
50-
this.notifier = new Notifier(this)
52+
this.notifier = new Notifier(this);
5153

5254
/** Extendable logger. */
5355
this.log = createLogger("[Pymakr]");
@@ -57,7 +59,6 @@ class PyMakr {
5759
this.terminalPort = 5364 + ((Math.random() * 10240) | 0);
5860

5961
this.onUpdatedConfig("silent");
60-
this.context = context;
6162

6263
/** The package.json manifest */
6364
this.manifest = manifest;
@@ -88,6 +89,8 @@ class PyMakr {
8889
this.registerWithIde();
8990
this.setup();
9091
this.handlePendingActions();
92+
93+
this.notifier.notifications.showReleaseNotes();
9194
}
9295

9396
handlePendingActions() {
@@ -165,8 +168,7 @@ class PyMakr {
165168
*/
166169
onUpdatedConfig(mode) {
167170
this.log.level = this.log.levels[this.config.get().debug.logLevel];
168-
if (this.log.level >= 5)
169-
process.env.debug = this.log.level === 5 ? 'true' : 'silly'
171+
if (this.log.level >= 5) process.env.debug = this.log.level === 5 ? "true" : "silly";
170172

171173
this.log.filter = this.config.get().debug.logFilter !== "" ? new RegExp(this.config.get().debug.logFilter) : "";
172174
if (mode !== "silent") this.log.info("updated config:", this.config.get());

src/commands/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class Commands {
101101
return this.pymakr.notifier.notifications.cantSafebootOfflineDevice();
102102

103103
const timeout = 10000;
104-
vscode.window.withProgress({ location: vscode.ProgressLocation.Notification }, async (progress) => {
104+
return vscode.window.withProgress({ location: vscode.ProgressLocation.Notification }, async (progress) => {
105105
progress.report({ message: "Safe booting" });
106106
const error = () => this.pymakr.notifier.notifications.couldNotSafeboot(device);
107107
await waitFor(device.safeBoot(), timeout, error);

src/utils/Notifier.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const vscode = require("vscode");
2+
const { createStateObject } = require("./storageObj");
23

34
/**
45
* @typedef {string} btnText selecting this option will not hide the notification in the future
@@ -21,6 +22,9 @@ class Notifier {
2122
warning: vscode.window.showWarningMessage,
2223
error: vscode.window.showErrorMessage,
2324
};
25+
this.state = {
26+
lastReadReleaseNotes: createStateObject(this.pymakr.context.globalState, "lastReadReleaseNotes"),
27+
};
2428
}
2529

2630
/**
@@ -251,6 +255,13 @@ class Notifier {
251255
"": [null, this.DONT_SHOW_AGAIN],
252256
});
253257
},
258+
showReleaseNotes: async () => {
259+
const uri = vscode.Uri.file(`${__dirname}/../../RELEASE_NOTES_2.22.0.md`);
260+
if (this.state.lastReadReleaseNotes.get() !== uri.fsPath) {
261+
this.state.lastReadReleaseNotes.set(uri.fsPath);
262+
vscode.commands.executeCommand("markdown.showPreview", uri);
263+
}
264+
},
254265
};
255266
}
256267

test/suite/integration/devmode.basic.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ test("can use devmode", async () => {
5454
writeFileSync(projectPath1 + "/main.py", 'print("hello world again")');
5555
await new Promise((resolve) => device.readUntil("hello world again", resolve));
5656
});
57+
test("devices with looping scripts will be stopped and restarted on file changes repeatedly", async () => {
58+
writeFileSync(projectPath1 + "/main.py", 'print("hello world again again")');
59+
await new Promise((resolve) => device.readUntil("hello world again again", resolve));
60+
});
5761
test("can stop devMode", async () => {
5862
await pymakr.commands.stopDevMode({ project });
5963
assert(!project.watcher.active);

test/suite/integration/probs.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ const PROJECT_STORE_TIMEOUT = 10000;
99
*/
1010
const prepDevice = async (device) => {
1111
device.adapter.__proxyMeta.clearQueue();
12+
console.log("[PREP] Waiting for idle...");
1213
await device.adapter.__proxyMeta.idle;
1314
await device.connect();
15+
console.log("[PREP] Safebooting...");
1416
await pymakr.commands.safeBootDevice({ device });
1517
// TODO timeout here should not be required. High priority!
16-
await new Promise((resolve) => setTimeout(resolve, 500));
18+
console.log("[PREP] Safebooting complete!");
19+
// await new Promise((resolve) => setTimeout(resolve, 1500));
20+
console.log("[PREP] Erasing...");
1721
await pymakr.commands.eraseDevice({ device });
22+
console.log("[PREP] Erasing complete!");
23+
console.log("[PREP] Disconnecting...");
1824
await device.disconnect();
25+
console.log("[PREP] Disconnecting complete!");
1926
};
2027

2128
module.exports = {

0 commit comments

Comments
 (0)