Compare commits
2 Commits
c232332d69
...
9bcc49059e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9bcc49059e | ||
|
|
0c6199d8e4 |
@@ -1,24 +1,24 @@
|
||||
goog.loadJs('web', () => {
|
||||
|
||||
goog.require('path');
|
||||
goog.require('Mustache');
|
||||
goog.require('Mixly.Env');
|
||||
goog.require('Mixly.Events');
|
||||
goog.require('Mixly.Msg');
|
||||
goog.require('Mixly.Ampy');
|
||||
goog.require('Mixly.Web');
|
||||
goog.provide('Mixly.Web.Ampy');
|
||||
goog.require('path');
|
||||
goog.require('Mustache');
|
||||
goog.require('Mixly.Env');
|
||||
goog.require('Mixly.Events');
|
||||
goog.require('Mixly.Msg');
|
||||
goog.require('Mixly.Ampy');
|
||||
goog.require('Mixly.Web');
|
||||
goog.provide('Mixly.Web.Ampy');
|
||||
|
||||
const {
|
||||
const {
|
||||
Env,
|
||||
Events,
|
||||
Msg,
|
||||
Ampy,
|
||||
Web
|
||||
} = Mixly;
|
||||
} = Mixly;
|
||||
|
||||
|
||||
class AmpyExt extends Ampy {
|
||||
class AmpyExt extends Ampy {
|
||||
static {
|
||||
this.LS = goog.readFileSync(path.join(Env.templatePath, 'python/ls.py'));
|
||||
this.LS_RECURSIVE = goog.readFileSync(path.join(Env.templatePath, 'python/ls-recursive.py'));
|
||||
@@ -228,9 +228,10 @@ class AmpyExt extends Ampy {
|
||||
if (!await this.exitRawREPL()) {
|
||||
throw new Error(Msg.Lang['ampy.exitRawREPLFailed']);
|
||||
}
|
||||
/*if (!await this.exitREPL()) {
|
||||
// 发送 Ctrl+D 触发软复位,让设备执行上传的 main.py
|
||||
if (!await this.exitREPL()) {
|
||||
throw new Error(Msg.Lang['ampy.exitREPLFailed']);
|
||||
}*/
|
||||
}
|
||||
await this.#device_.close();
|
||||
this.#active_ = false;
|
||||
}
|
||||
@@ -417,13 +418,17 @@ class AmpyExt extends Ampy {
|
||||
|
||||
async dispose() {
|
||||
this.#active_ = false;
|
||||
if (this.#device_) {
|
||||
await this.#device_.dispose();
|
||||
this.#device_ = null;
|
||||
}
|
||||
if (this.#events_) {
|
||||
this.#events_.reset();
|
||||
this.#events_ = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Web.Ampy = AmpyExt;
|
||||
Web.Ampy = AmpyExt;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user