Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
66274bfb
Commit
66274bfb
authored
Jun 20, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Electron: Prioritise server launch, for better response.
parent
581ea806
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
package/build_py2exe.py
package/build_py2exe.py
+1
-2
package/electron/app/main.js
package/electron/app/main.js
+3
-4
package/electron/app/servermgr.js
package/electron/app/servermgr.js
+2
-2
No files found.
package/build_py2exe.py
View file @
66274bfb
...
...
@@ -152,8 +152,7 @@ def create_run_batch_file():
entry point built by Electron.
"""
batch_text
=
"@echo off
\n
"
+
\
"start %s"
%
os
.
path
.
join
(
project_root_dir
,
"arduexec"
,
"ardublockly.exe"
)
"start %s"
%
os
.
path
.
join
(
"arduexec"
,
"ardublockly.exe"
)
batch_location
=
os
.
path
.
join
(
project_root_dir
,
"ardublockly_run.bat"
)
try
:
batch_file
=
open
(
batch_location
,
"w"
)
...
...
package/electron/app/main.js
View file @
66274bfb
...
...
@@ -28,6 +28,8 @@ var mainWindowState = windowStateKeeper('main', {
});
app
.
on
(
'
ready
'
,
function
()
{
server
.
startServer
();
mainWindow
=
new
BrowserWindow
({
x
:
mainWindowState
.
x
,
y
:
mainWindowState
.
y
,
...
...
@@ -52,15 +54,12 @@ app.on('ready', function () {
if
(
env
.
name
===
'
development
'
)
{
appMenu
.
setArdublocklyMenu
(
true
);
//mainWindow.openDevTools();
}
else
{
appMenu
.
setArdublocklyMenu
();
}
mainWindow
.
loadUrl
(
'
http://localhost:8000/ardublockly
'
);
server
.
startServer
();
mainWindow
.
on
(
'
close
'
,
function
()
{
mainWindowState
.
saveState
(
mainWindow
);
mainWindow
=
null
;
...
...
@@ -68,7 +67,7 @@ app.on('ready', function () {
});
app
.
on
(
'
window-all-closed
'
,
function
()
{
server
.
stopServer
()
server
.
stopServer
()
;
// Might need to add OS X exception
// https://github.com/atom/electron/issues/1357
app
.
quit
();
...
...
package/electron/app/servermgr.js
View file @
66274bfb
...
...
@@ -32,8 +32,8 @@ function getServerExecLocation() {
var
ardublocklyRootDir
=
jetpack
.
dir
(
__dirname
);
var
oldArdublocklyRootDir
=
''
;
while
(
ardublocklyRootDir
.
path
()
!=
oldArdublocklyRootDir
)
{
console
.
log
(
tag
+
'
Search for Ardublockly project root dir:
'
+
ardublocklyRootDir
.
cwd
());
//
console.log(tag + 'Search for Ardublockly project root dir: ' +
//
ardublocklyRootDir.cwd());
// Check if file /ardublokly/index.html exists within current path
if
(
jetpack
.
exists
(
ardublocklyRootDir
.
path
(
'
ardublockly
'
,
'
index.html
'
)))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment