Skip to content

Commit 3dca318

Browse files
record status of installing python
1 parent 2387d38 commit 3dca318

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Tools/WinMLDashboard/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For **ONNX Version:**
4545

4646
|Version |For Windows 10 Build|
4747
|------------|--------------------|
48-
|1.2 |[1809 (OS build 17763)(https://support.microsoft.com/en-us/help/4464619/windows-10-update-history)|
48+
|1.2 |[1809 (OS build 17763)](https://support.microsoft.com/en-us/help/4464619/windows-10-update-history)|
4949
|1.3 |after 1809 (OS build 17763)|
5050

5151
<img src="./public/Converter.png" width=800/>

Tools/WinMLDashboard/src/view/convert/View.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as fs from 'fs';
2+
import * as path from 'path';
23
import * as React from 'react';
34
import { connect } from 'react-redux';
45

@@ -9,6 +10,8 @@ import { Spinner } from 'office-ui-fabric-react/lib/Spinner';
910
import { TextField } from 'office-ui-fabric-react/lib/TextField';
1011
import Select from 'react-select';
1112

13+
import { winmlDataFolder } from '../../native/appData';
14+
1215
import Collapsible from '../../components/Collapsible';
1316
import { setFile, setQuantizationOption, setSaveFileName } from '../../datastore/actionCreators';
1417
import IState from '../../datastore/state';
@@ -125,7 +128,7 @@ class ConvertView extends React.Component<IComponentProperties, IComponentState>
125128
return <Spinner label="Converting..." />;
126129
}
127130
this.localPython = this.localPython || getLocalPython();
128-
if (!this.localPython) {
131+
if (!this.localPython || !fs.existsSync(path.join(winmlDataFolder, '/python/PIResult.txt'))) {
129132
return this.pythonChooser();
130133
}
131134
return this.converterView();
@@ -184,6 +187,10 @@ class ConvertView extends React.Component<IComponentProperties, IComponentState>
184187
await pip(['install', '-r', packagedFile('requirements.txt'), '--no-warn-script-location'], this.outputListener);
185188
this.setState({ currentStep: Step.Idle });
186189
log.info("python environment is installed successfully");
190+
fs.writeFile(path.join(winmlDataFolder, '/python/PIResult.txt'), 'Python is installed successfully!', (err) => {
191+
if (err) { throw err; }
192+
log.info('PIResult.txt Saved!');
193+
});
187194
pythonDialogOptions.message = 'python environment is installed successfully!'
188195
require('electron').remote.dialog.showMessageBox(require('electron').remote.getCurrentWindow(), pythonDialogOptions)
189196
} catch (error) {
@@ -362,7 +369,7 @@ class ConvertView extends React.Component<IComponentProperties, IComponentState>
362369
}
363370
// Convert successfully
364371
log.info(this.state.source + " is converted successfully.");
365-
convertDialogOptions.message = 'convert successfully!'
372+
convertDialogOptions.message = 'Converted successfully!'
366373
require('electron').remote.dialog.showMessageBox(require('electron').remote.getCurrentWindow(), convertDialogOptions)
367374
this.setState({ currentStep: Step.Idle, source: undefined, console:"Converted successfully!!"});
368375

0 commit comments

Comments
 (0)