Skip to content

Commit 14bd619

Browse files
committed
merging
1 parent a310eed commit 14bd619

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

camera.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ 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
206205
os.remove(PHOTO_PATH + "/" + filename[:filename.rfind(".")] + PHOTO_THUMB_SUFFIX + self._camera.PHOTO_FILE_EXT)
207206
for photo in self._photos:
208207
if photo["name"] == filename:

cnn_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
while True:
1212
i = cam.get_image().resize(128, 128).mat()
1313
results = classifier.classify_image(i, 128, 128)
14-
print "results: " + str(results)
14+
print("results: " + str(results))

main.py

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

4645
logger = logging.getLogger()
4746
logger.setLevel(logging.DEBUG)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ Pypubsub==4.0.0
2020
pytz==2018.4
2121
six==1.11.0
2222
smbus2==0.2.0
23-
tensorflow==0.11.0
2423
Werkzeug==0.14.1
24+
pylint==1.9.2

wifi.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,40 @@ def start_hostapd(cls):
4949
adapter = cls.get_adapter_type()
5050
hostapd_type = cls.hostapds.get(adapter)
5151
try:
52-
print "starting hostapd..."
52+
print("starting hostapd...")
5353
out = os.system("/usr/sbin/" + hostapd_type + " -B /etc/hostapd/" + hostapd_type + ".conf")
54-
print "hostapd out: " + str(out)
54+
print("hostapd out: " + str(out))
5555

5656
except subprocess.CalledProcessError as e:
57-
print e.output
57+
print(e.output)
5858

5959
@classmethod
6060
def start_dnsmasq(cls):
6161
try:
62-
print "starting dnsmasq..."
62+
print("starting dnsmasq...")
6363
out = os.system("systemctl start dnsmasq")
64-
print "dnsmasq out: " + str(out)
64+
print("dnsmasq out: " + str(out))
6565

6666
except subprocess.CalledProcessError as e:
67-
print e.output
67+
print(e.output)
6868

6969
@classmethod
7070
def stop_hostapd(cls):
7171
try:
72-
print "stopping hostapd..."
72+
print("stopping hostapd...")
7373
out = subprocess.check_output(["sudo", "pkill", "-9", "hostapd"])
74-
print "hostapd out: " + str(out)
74+
print("hostapd out: " + str(out))
7575
except subprocess.CalledProcessError as e:
76-
print e.output
76+
print(e.output)
7777

7878
@classmethod
7979
def stop_dnsmasq(cls):
8080
try:
81-
print "stopping dnsmasq..."
81+
print("stopping dnsmasq...")
8282
out = subprocess.check_output(["systemctl", "stop", "dnsmasq"])
83-
print "dnsmasq out: " + str(out)
83+
print("dnsmasq out: " + str(out))
8484
except subprocess.CalledProcessError as e:
85-
print e.output
85+
print(e.output)
8686

8787
@classmethod
8888
def get_ipaddr(cls, ifname):
@@ -112,7 +112,7 @@ def register_ipaddr(cls, bot_uid, bot_name, bot_ipaddr, user_email):
112112
if ret.getcode() != 200:
113113
raise Exception()
114114
except Exception as e:
115-
print "except: " + str(e)
115+
print("except: " + str(e))
116116
raise
117117

118118
@classmethod
@@ -149,14 +149,14 @@ def start_as_client(cls):
149149
time.sleep(1.0)
150150
out = os.system("wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf > /dev/null 2>&1")
151151
out += os.system("dhclient -1 wlan0")
152-
print out
152+
print(out)
153153
try:
154154
cls.register_ipaddr(cls.get_macaddr("wlan0"), cls.get_config().get('bot_name', 'CoderBot'), cls.get_ipaddr("wlan0"), "roberto.previtera@gmail.com")
155-
print "registered bot, ip: " + str(cls.get_ipaddr("wlan0") + " name: " + cls.get_config().get('bot_name', 'CoderBot'))
155+
print("registered bot, ip: " + str(cls.get_ipaddr("wlan0") + " name: " + cls.get_config().get('bot_name', 'CoderBot')))
156156
except:
157157
pass
158158
except subprocess.CalledProcessError as e:
159-
print e.output
159+
print(e.output)
160160
raise
161161

162162
@classmethod
@@ -171,22 +171,22 @@ def start_as_ap(cls):
171171
out += subprocess.check_output(["ip", "a", "add", "10.0.0.1/24", "dev", "wlan0"])
172172
out += subprocess.check_output(["ip", "link", "set", "dev", "wlan0", "up"])
173173
out += subprocess.check_output(["ifconfig"])
174-
print out
174+
print(out)
175175
cls.start_hostapd()
176176
cls.start_dnsmasq()
177177

178178
@classmethod
179179
def start_service(cls):
180180
config = cls.load_config()
181181
if config["wifi_mode"] == "ap":
182-
print "starting as ap..."
182+
print("starting as ap...")
183183
cls.start_as_ap()
184184
elif config["wifi_mode"] == "client":
185-
print "starting as client..."
185+
print("starting as client...")
186186
try:
187187
cls.start_as_client()
188188
except:
189-
print "Unable to register ip, revert to ap mode"
189+
print("Unable to register ip, revert to ap mode")
190190
cls.start_as_ap()
191191

192192
def main():

0 commit comments

Comments
 (0)