8000 remove old code and bypass some warning by fpliger · Pull Request #59 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

remove old code and bypass some warning #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more cleaning
  • Loading branch information
fpliger committed Apr 28, 2022
commit ec38f9c1516efb9a4d53461351910256565b9e11
6 changes: 0 additions & 6 deletions pyscriptjs/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
scriptsQueue,
} from './stores';

let iconSize = 2;
let pyodideReadyPromise;

const initializePyodide = async () => {
Expand All @@ -26,11 +25,6 @@
value[newEnv['id']] = newEnv;
});

let showNavBar = false;
navBarOpen.subscribe(value => {
showNavBar = value;
});

// now we call all initializers before we actually executed all page scripts
for (let initializer of $initializers) {
await initializer();
Expand Down
12 changes: 6 additions & 6 deletions pyscriptjs/src/components/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { componentDetailsNavOpen, loadedEnvironments, mode, pyodideLoaded } from '../stores';
import { loadedEnvironments, mode, pyodideLoaded } from '../stores';
import { guidGenerator, addClasses } from '../utils';
// Premise used to connect to the first available pyodide interpreter
let pyodideReadyPromise;
Expand All @@ -13,10 +13,6 @@ loadedEnvironments.subscribe(value => {
environments = value;
});

let propertiesNavOpen;
componentDetailsNavOpen.subscribe(value => {
propertiesNavOpen = value;
});

mode.subscribe(value => {
currentMode = value;
Expand Down Expand Up @@ -52,7 +48,11 @@ export class BaseEvalElement extends HTMLElement {
this.outputElement.hidden = false;
}

postEvaluate() {}
// subclasses should overwrite this method to define custom logic
// after code has been evaluated
postEvaluate() {
return null;
}

checkId() {
if (!this.id) this.id = this.constructor.name + '-' + guidGenerator();
Expand Down
5 changes: 1 addition & 4 deletions pyscriptjs/src/components/pybox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ export class PyBox extends HTMLElement {
this.widths.push(`w-${w}`);
}
} else {
for (const el of mainDiv.childNodes) {
this.widths.push(`w-1/${mainDiv.childNodes.length}`);
}
this.widths = [...this.widths, ...[`w-1/${mainDiv.childNodes.length}`]];
}

this.widths.forEach((width, index)=>{
const node: ChildNode = mainDiv.childNodes[index];
// @ts-ignore
addClasses(node, [width, 'mx-4'])

})
Expand Down
2 changes: 1 addition & 1 deletion pyscriptjs/src/components/pybutton.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseEvalElement } from './base';
import { addClasses, ltrim, htmlDecode } from '../utils';
import { addClasses, htmlDecode } from '../utils';

export class PyButton extends BaseEvalElement {
shadow: ShadowRoot;
Expand Down
14 changes: 0 additions & 14 deletions pyscriptjs/src/components/pyenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ import { loadPackage, loadFromFile } from '../interpreter';

// Premise used to connect to the first available pyodide interpreter
let pyodideReadyPromise;
let environments;
let currentMode;

pyodideLoaded.subscribe(value => {
pyodideReadyPromise = value;
});

loadedEnvironments.subscribe(value => {
environments = value;
});

mode.subscribe(value => {
currentMode = value;
});

export class PyEnv extends HTMLElement {
shadow: ShadowRoot;
Expand Down
0