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
Show 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():
...
@@ -152,8 +152,7 @@ def create_run_batch_file():
entry point built by Electron.
entry point built by Electron.
"""
"""
batch_text
=
"@echo off
\n
"
+
\
batch_text
=
"@echo off
\n
"
+
\
"start %s"
%
os
.
path
.
join
(
project_root_dir
,
"arduexec"
,
"start %s"
%
os
.
path
.
join
(
"arduexec"
,
"ardublockly.exe"
)
"ardublockly.exe"
)
batch_location
=
os
.
path
.
join
(
project_root_dir
,
"ardublockly_run.bat"
)
batch_location
=
os
.
path
.
join
(
project_root_dir
,
"ardublockly_run.bat"
)
try
:
try
:
batch_file
=
open
(
batch_location
,
"w"
)
batch_file
=
open
(
batch_location
,
"w"
)
...
...
package/electron/app/main.js
View file @
66274bfb
...
@@ -28,6 +28,8 @@ var mainWindowState = windowStateKeeper('main', {
...
@@ -28,6 +28,8 @@ var mainWindowState = windowStateKeeper('main', {
});
});
app
.
on
(
'
ready
'
,
function
()
{
app
.
on
(
'
ready
'
,
function
()
{
server
.
startServer
();
mainWindow
=
new
BrowserWindow
({
mainWindow
=
new
BrowserWindow
({
x
:
mainWindowState
.
x
,
x
:
mainWindowState
.
x
,
y
:
mainWindowState
.
y
,
y
:
mainWindowState
.
y
,
...
@@ -52,15 +54,12 @@ app.on('ready', function () {
...
@@ -52,15 +54,12 @@ app.on('ready', function () {
if
(
env
.
name
===
'
development
'
)
{
if
(
env
.
name
===
'
development
'
)
{
appMenu
.
setArdublocklyMenu
(
true
);
appMenu
.
setArdublocklyMenu
(
true
);
//mainWindow.openDevTools();
}
else
{
}
else
{
appMenu
.
setArdublocklyMenu
();
appMenu
.
setArdublocklyMenu
();
}
}
mainWindow
.
loadUrl
(
'
http://localhost:8000/ardublockly
'
);
mainWindow
.
loadUrl
(
'
http://localhost:8000/ardublockly
'
);
server
.
startServer
();
mainWindow
.
on
(
'
close
'
,
function
()
{
mainWindow
.
on
(
'
close
'
,
function
()
{
mainWindowState
.
saveState
(
mainWindow
);
mainWindowState
.
saveState
(
mainWindow
);
mainWindow
=
null
;
mainWindow
=
null
;
...
@@ -68,7 +67,7 @@ app.on('ready', function () {
...
@@ -68,7 +67,7 @@ app.on('ready', function () {
});
});
app
.
on
(
'
window-all-closed
'
,
function
()
{
app
.
on
(
'
window-all-closed
'
,
function
()
{
server
.
stopServer
()
server
.
stopServer
()
;
// Might need to add OS X exception
// Might need to add OS X exception
// https://github.com/atom/electron/issues/1357
// https://github.com/atom/electron/issues/1357
app
.
quit
();
app
.
quit
();
...
...
package/electron/app/servermgr.js
View file @
66274bfb
...
@@ -32,8 +32,8 @@ function getServerExecLocation() {
...
@@ -32,8 +32,8 @@ function getServerExecLocation() {
var
ardublocklyRootDir
=
jetpack
.
dir
(
__dirname
);
var
ardublocklyRootDir
=
jetpack
.
dir
(
__dirname
);
var
oldArdublocklyRootDir
=
''
;
var
oldArdublocklyRootDir
=
''
;
while
(
ardublocklyRootDir
.
path
()
!=
oldArdublocklyRootDir
)
{
while
(
ardublocklyRootDir
.
path
()
!=
oldArdublocklyRootDir
)
{
console
.
log
(
tag
+
'
Search for Ardublockly project root dir:
'
+
//
console.log(tag + 'Search for Ardublockly project root dir: ' +
ardublocklyRootDir
.
cwd
());
//
ardublocklyRootDir.cwd());
// Check if file /ardublokly/index.html exists within current path
// Check if file /ardublokly/index.html exists within current path
if
(
jetpack
.
exists
(
if
(
jetpack
.
exists
(
ardublocklyRootDir
.
path
(
'
ardublockly
'
,
'
index.html
'
)))
{
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