Skip to content

Commit 76cad32

Browse files
committed
update scripts
1 parent 5159a09 commit 76cad32

File tree

11 files changed

+263
-67
lines changed

11 files changed

+263
-67
lines changed

main.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ def handle_wifi():
9292

9393
@app.route("/update", methods=["GET"])
9494
def handle_update():
95-
logging.info("updating system.1")
96-
out = subprocess.check_output(["./scripts/update_os.sh"],
95+
logging.info("updating system.start")
96+
out_os = subprocess.check_output(["./scripts/update_os.sh"],
9797
stderr=subprocess.STDOUT)
98-
logging.info("updating system.2: " + str(out))
98+
logging.info("updating system.os: " + str(out_os))
9999

100-
out = subprocess.check_output(["./scripts/update_coderbot.sh"],
101-
stderr=subprocess.STDOUT)
102-
logging.info("updating system.3: " + str(out))
100+
out_bot = subprocess.check_output(["./scripts/update_coderbot.sh"],
101+
stderr=subprocess.STDOUT)
102+
logging.info("updating system.bot: " + str(out_bot))
103+
return out_os + out_bot
103104

104105
@app.route("/bot", methods=["GET"])
105106
def handle_bot():

messages.pot

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Translations template for PROJECT.
2-
# Copyright (C) 2015 ORGANIZATION
2+
# Copyright (C) 2016 ORGANIZATION
33
# This file is distributed under the same license as the PROJECT project.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
55
#
66
#, fuzzy
77
msgid ""
88
msgstr ""
99
"Project-Id-Version: PROJECT VERSION\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2015-10-14 21:55+0000\n"
11+
"POT-Creation-Date: 2016-01-03 21:39+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -73,7 +73,7 @@ msgstr ""
7373
msgid "Sensor"
7474
msgstr ""
7575

76-
#: templates/blocks_adv.xml:253 templates/blocks_std.xml:73
76+
#: templates/blocks_adv.xml:255 templates/blocks_std.xml:73
7777
msgid "Sound"
7878
msgstr ""
7979

@@ -306,51 +306,93 @@ msgstr ""
306306
msgid "Reboot"
307307
msgstr ""
308308

309-
#: templates/config.html:164 templates/config.html:185
309+
#: templates/config.html:162
310+
msgid "Update System"
311+
msgstr ""
312+
313+
#: templates/config.html:165 templates/config.html:186
310314
msgid "Cancel"
311315
msgstr ""
312316

313-
#: templates/config.html:165 templates/program.html:18
317+
#: templates/config.html:166 templates/program.html:18
314318
#: templates/program.html:26
315319
msgid "Save"
316320
msgstr ""
317321

318-
#: templates/config.html:172
322+
#: templates/config.html:173
319323
msgid "WiFi Client mode access data"
320324
msgstr ""
321325

322-
#: templates/config.html:174
326+
#: templates/config.html:175
323327
msgid "WiFi mode"
324328
msgstr ""
325329

326-
#: templates/config.html:176
330+
#: templates/config.html:177
327331
msgid "Access Point"
328332
msgstr ""
329333

330-
#: templates/config.html:178
334+
#: templates/config.html:179
331335
msgid "Client"
332336
msgstr ""
333337

334-
#: templates/config.html:180
338+
#: templates/config.html:181
335339
msgid "WiFi name"
336340
msgstr ""
337341

338-
#: templates/config.html:182
342+
#: templates/config.html:183
339343
msgid "WiFi password"
340344
msgstr ""
341345

342-
#: templates/config.html:186
346+
#: templates/config.html:187
343347
msgid "Apply Wifi config"
344348
msgstr ""
345349

346-
#: templates/config.html:193
350+
#: templates/config.html:194
347351
msgid "WiFi AP mode access"
348352
msgstr ""
349353

350-
#: templates/config.html:205
354+
#: templates/config.html:195
355+
msgid "Access Point mode is being set"
356+
msgstr ""
357+
358+
#: templates/config.html:197 templates/config.html:209
359+
msgid "Wait 30 seconds"
360+
msgstr ""
361+
362+
#: templates/config.html:198
363+
msgid "Connect your device to the \"coderbot\" named wifi"
364+
msgstr ""
365+
366+
#: templates/config.html:199 templates/config.html:211
367+
msgid "Click on the following link"
368+
msgstr ""
369+
370+
#: templates/config.html:206
351371
msgid "WiFi Client mode access"
352372
msgstr ""
353373

374+
#: templates/config.html:207
375+
msgid "Client mode is being set"
376+
msgstr ""
377+
378+
#: templates/config.html:210
379+
msgid ""
380+
"Connect your device to your own wifi (wifi network must be connected to "
381+
"internet)"
382+
msgstr ""
383+
384+
#: templates/config.html:218
385+
msgid "System update"
386+
msgstr ""
387+
388+
#: templates/config.html:219
389+
msgid "Update log (it may require several minutes)"
390+
msgstr ""
391+
392+
#: templates/config.html:221 templates/config_params.html:30
393+
msgid "Close"
394+
msgstr ""
395+
354396
#: templates/config_params.html:20
355397
msgid "Say what:"
356398
msgstr ""
@@ -392,8 +434,10 @@ msgstr ""
392434
msgid "Stop"
393435
msgstr ""
394436

395-
#: templates/config_params.html:30
396-
msgid "Close"
437+
#: templates/config_params.html:31
438+
msgid ""
439+
"Update System? (this requires that CoderBot is connected to the internet "
440+
"(via wifi or lan cable, the operation will take a few minutes)."
397441
msgstr ""
398442

399443
#: templates/control.html:5 templates/program.html:5

static/js/control.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,12 @@ $(document).on( "pagecreate", '#page-preferences', function( event ) {
163163
}
164164
});
165165
$('#b_update').on("click", function (){
166-
if(confirm("Update System? (this requires a internet connection and will takes a few minutes).")){
167-
$.get(url='/update');
166+
if(confirm(BotMessages.UpdateSystem)){
167+
$('#popup-update-system').popup('open');
168+
$.get(url='/update', success=function (data) {
169+
$('#i_update_system_log').text(data);
170+
$('#b_update_system_close').removeClass('ui-disabled');
171+
});
168172
}
169173
});
170174
});

templates/config.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,26 +192,34 @@ <h3>{% trans %}WiFi Client mode access data{% endtrans %}</h3>
192192
<div data-role="popup" id="popup-wifi-ap" data-history="false" data-theme="a" class="ui-corner-all" data-dismissible="false" data-position-to="window">
193193
<div style="padding:10px 20px;">
194194
<h3>{% trans %}WiFi AP mode access{% endtrans %}</h3>
195-
<p>Access Point mode is being set:
195+
<p>{% trans %}Access Point mode is being set{% endtrans %}:
196196
<ol>
197-
<li>Wait 30 seconds</li>
198-
<li>Connect your device to the "coderbot" named wifi</li>
199-
<li>Click on the following link: <a href="http://coderbot:8080">CoderBot (AP mode)</a></li>
197+
<li>{% trans %}Wait 30 seconds{% endtrans %}</li>
198+
<li>{% trans %}Connect your device to the "coderbot" named wifi{% endtrans %}</li>
199+
<li>{% trans %}Click on the following link{% endtrans %}: <a href="http://coder.bot:8080">CoderBot (AP mode)</a></li>
200200
</ol>
201201
</p>
202202
</div>
203203
</div>
204204
<div data-role="popup" id="popup-wifi-client" data-history="false" data-theme="a" class="ui-corner-all" data-dismissible="false" data-position-to="window">
205205
<div style="padding:10px 20px;">
206206
<h3>{% trans %}WiFi Client mode access{% endtrans %}</h3>
207-
<p>Client mode is being set:
207+
<p>{% trans %}Client mode is being set{% endtrans %}:
208208
<ol>
209-
<li>Wait 30 seconds</li>
210-
<li>Connect your device to your own wifi (wifi network must be connected to internet)</li>
211-
<li>Click on the following link: <a href="http://coderbot.local:8080">CoderBot (client mode)</a></li>
209+
<li>{% trans %}Wait 30 seconds{% endtrans %}</li>
210+
<li>{% trans %}Connect your device to your own wifi (wifi network must be connected to internet){% endtrans %}</li>
211+
<li>{% trans %}Click on the following link{% endtrans %}: <a href="http://coderbot.local:8080">CoderBot (client mode)</a></li>
212212
</ol>
213213
</p>
214214
</div>
215215
</div>
216+
<div data-role="popup" id="popup-update-system" data-history="false" data-theme="a" class="ui-corner-all" data-dismissible="false" data-position-to="window">
217+
<div style="padding:10px 20px;">
218+
<h3>{% trans %}System update{% endtrans %}</h3>
219+
<p>{% trans %}Update log (it may require several minutes){% endtrans %}:</p>
220+
<textarea readonly=true cols="80" rows="20" style="overflow-y: scroll; height: 100px; resize: none; " id="i_update_system_log"></textarea>
221+
<a href="#" id="b_update_system_close" data-rel="back" data-role="button" class="ui-btn ui-shadow ui-corner-all ui-btn-b ui-mini ui-disabled">{% trans %}Close{% endtrans %}</a>
222+
</div>
223+
</div>
216224
</div>
217225

templates/config_params.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
BotMessages.ProgramStatusStop = "{%trans%}stopped{%endtrans%}";
2929
BotMessages.ProgramDialogStop = "{%trans%}Stop{%endtrans%}";
3030
BotMessages.ProgramDialogClose = "{%trans%}Close{%endtrans%}";
31+
BotMessages.UpdateSystem = "{%trans%}Update System? (this requires that CoderBot is connected to the internet (via wifi or lan cable, the operation will take a few minutes).{%endtrans%}"
3132
</script>
3233
<style>
3334
.ui-content-stream {

templates/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@
66
<title>CoderBot</title>
77
<link rel="shortcut icon" href="favicon.ico">
88
<link rel="stylesheet" href="../static/css/bootstrap.min.css">
9+
<style>
10+
html,
11+
body,
12+
#page-preferences {
13+
height: 100%;
14+
margin: 0;
15+
padding: 0;
16+
}
17+
18+
#page-preferences,
19+
#page-preferences * {
20+
-webkit-box-sizing: border-box;
21+
-moz-box-sizing: border-box;
22+
box-sizing: border-box;
23+
}
24+
25+
#page-preferences .ui-content {
26+
height: inherit; /* inherit height without padding nor border */
27+
}
28+
</style>
929
<script src="js/jquery-2.1.0.min.js"></script>
1030
<script src="js/bootstrip-min.js"></script>
1131
<script src="js/coderbot.js"></script>

templates/main.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@
77
<link rel="icon" type="image/png" href="/images/icons/coderbot_logo_79.png"/>
88
<link rel="stylesheet" href="../css/jquery.mobile-1.4.5.min.css">
99
<link rel="stylesheet" href="../css/coderbot.css">
10+
<style>
11+
html,
12+
body,
13+
#page-preferences {
14+
height: 100%;
15+
margin: 0;
16+
padding: 0;
17+
}
18+
19+
#page-preferences,
20+
#page-preferences * {
21+
-webkit-box-sizing: border-box;
22+
-moz-box-sizing: border-box;
23+
box-sizing: border-box;
24+
}
25+
26+
#page-preferences .ui-content {
27+
height: inherit; /* inherit height without padding nor border */
28+
}
29+
</style>
1030
{%include "config_params.html"%}
1131
<script type="text/javascript" src="js/blockly/blockly_compressed.js"></script>
1232
<script type="text/javascript" src="js/blockly/blocks_compressed.js"></script>
1.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)