Skip to content

Commit a310eed

Browse files
committed
merging from py3-deployable
2 parents 63351d7 + c9800d9 commit a310eed

File tree

8 files changed

+10
-37
lines changed

8 files changed

+10
-37
lines changed

audio.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(self):
8282
#self._google_speech_client = speech.SpeechClient()
8383

8484
def exit(self):
85-
pass
85+
pass
8686
# cleanup stuff.
8787
#self.stream_in.close()
8888
#self.pyaudio.terminate()
@@ -201,33 +201,6 @@ def speech_recog(self, model):
201201
logging.info("recog text: " + recog_text)
202202
return recog_text
203203

204-
# def speech_recog_google(self, locale):
205-
# config = types.RecognitionConfig(
206-
# encoding=enums.RecognitionConfig.AudioEncoding.LINEAR16,
207-
# sample_rate_hertz=RATE,
208-
# language_code=locale)
209-
# streaming_config = types.StreamingRecognitionConfig(
210-
# config=config,
211-
# interim_results=False,
212-
# single_utterance=True)
213-
#
214-
# t1 = time.time()
215-
# with self.stream_in as stream:
216-
# audio_generator = stream.generator()
217-
# requests = (types.StreamingRecognizeRequest(audio_content=content)
218-
# for content in audio_generator)
219-
#
220-
# responses = self._google_speech_client.streaming_recognize(streaming_config, requests)
221-
222-
# Now, put the transcription responses to use.
223-
# for response in responses:
224-
# if time.time() - t1 > 10:
225-
# return ""
226-
# if response.results:
227-
# result = response.results[0]
228-
# if result.is_final:
229-
# return result.alternatives[0].transcript
230-
231204
class MicrophoneStream(object):
232205
"""Opens a recording stream as a generator yielding the audio chunks."""
233206
def __init__(self, fmt, rate, chunk):

camera.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def get_photo_thumb_file(self, filename):
202202
def delete_photo(self, filename):
203203
logging.info("delete photo: " + filename)
204204
os.remove(PHOTO_PATH + "/" + filename)
205+
<<<<<<< HEAD
205206
os.remove(PHOTO_PATH + "/" + filename[:filename.rfind(".")] + PHOTO_THUMB_SUFFIX + self._camera.PHOTO_FILE_EXT)
206207
for photo in self._photos:
207208
if photo["name"] == filename:
@@ -371,3 +372,4 @@ def find_class(self):
371372
def sleep(self, elapse):
372373
logging.debug("sleep: " + str(elapse))
373374
time.sleep(elapse)
375+

coderbot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,3 +419,4 @@ def restart(self):
419419

420420
def reboot(self):
421421
os.system('sudo reboot')
422+

data/program_find_text.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><block type=\"controls_whileUntil\" x=\"7\" y=\"60\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"text_print\"><value name=\"TEXT\"><block type=\"coderbot_adv_findText\"><field name=\"ACCEPT\">alpha</field><value name=\"COLOR\"><block type=\"text\"><field name=\"TEXT\">#a81300</field></block></value></block></value></block></statement></block></xml>", "code": "while True:\n get_prog_eng().check_end()\n get_cam().set_text(get_cam().find_text(accept=\"alpha\", back_color='#a81300'))\n", "name": "find_text"}
1+
{"dom_code": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><block type=\"controls_whileUntil\" id=\"Ke#n3UKfYnMbv!Cu`zzq\" x=\"7\" y=\"60\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"logic_boolean\" id=\"!M`eA*wRnoX2_dVQ_FE.\"><field name=\"BOOL\">TRUE</field></block></value><statement name=\"DO\"><block type=\"text_print\" id=\"yM]ThA`sar3kXv^[-,mV\"><value name=\"TEXT\"><block type=\"coderbot_adv_findText\" id=\"v)VQ.8j,.j_tq5%X1XuJ\"><field name=\"ACCEPT\">alpha</field><value name=\"COLOR\"><block type=\"text\" id=\"6;Vb;LrH4txPlXtmCfNs\"><field name=\"TEXT\">#802b29</field></block></value></block></value></block></statement></block></xml>", "code": "while True:\n get_prog_eng().check_end()\n get_cam().set_text(get_cam().find_text(accept=\"alpha\", back_color='#802b29'))\n", "name": "find_text"}

data/program_no_name.data

Lines changed: 0 additions & 1 deletion
This file was deleted.

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from flask_babel import Babel
4242
from flask_cors import CORS
4343
from werkzeug.datastructures import Headers
44-
#from flask_sockets import Sockets
44+
from flask_sockets import Sockets
4545

4646
logger = logging.getLogger()
4747
logger.setLevel(logging.DEBUG)

scripts/interfaces_ap

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
auto lo
2+
allow-hotplug wlan0
23
iface lo inet loopback
34
iface eth0 inet dhcp
4-
#allow-hotplug wlan0
5-
#iface wlan0 inet manual
6-
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
7-
#iface default inet dhcp
85
iface wlan0 inet static
96
address 10.0.0.1
107
netmask 255.255.255.0
118
wireless-power off
12-
9+
network 10.0.0.0
10+
broadcast 10.0.0.255

static/js/blockly/blocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Blockly.Python['coderbot_sleep'] = function(block) {
231231
// Generate Python for sleeping.
232232
var elapse = Blockly.Python.valueToCode(block, 'ELAPSE',
233233
Blockly.Python.ORDER_NONE) || '\'\'';
234-
return 'get_cam().sleep(' + elapse + ')\n';
234+
return 'get_bot().sleep(' + elapse + ')\n';
235235
};
236236

237237
Blockly.Blocks['coderbot_adv_move'] = {

0 commit comments

Comments
 (0)