smartpi 0.1.28__py3-none-any.whl → 0.1.29__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smartpi/__init__.py +4 -2
- smartpi/{gui.py → _gui.py} +3 -41
- smartpi/base_driver.py +1 -1
- {smartpi-0.1.28.dist-info → smartpi-0.1.29.dist-info}/METADATA +1 -1
- {smartpi-0.1.28.dist-info → smartpi-0.1.29.dist-info}/RECORD +7 -7
- {smartpi-0.1.28.dist-info → smartpi-0.1.29.dist-info}/WHEEL +0 -0
- {smartpi-0.1.28.dist-info → smartpi-0.1.29.dist-info}/top_level.txt +0 -0
smartpi/__init__.py
CHANGED
smartpi/{gui.py → _gui.py}
RENAMED
|
@@ -2,7 +2,7 @@ import socket
|
|
|
2
2
|
import json
|
|
3
3
|
import time
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class gui_client:
|
|
6
6
|
def __init__(self, host="127.0.0.1", port=65167):
|
|
7
7
|
self.sock = socket.create_connection((host, port))
|
|
8
8
|
self.clear()
|
|
@@ -44,44 +44,6 @@ class _gui_client:
|
|
|
44
44
|
def finish(self):
|
|
45
45
|
self.sock.close()
|
|
46
46
|
|
|
47
|
-
#
|
|
48
|
-
|
|
47
|
+
# 外部调用
|
|
48
|
+
gui = gui_client()
|
|
49
49
|
|
|
50
|
-
# 将类方法提升为模块级别的函数
|
|
51
|
-
def show_text(x, y, text, color="black", size=16):
|
|
52
|
-
_client_instance.show_text(x, y, text, color, size)
|
|
53
|
-
|
|
54
|
-
def print(text):
|
|
55
|
-
_client_instance.print(text)
|
|
56
|
-
|
|
57
|
-
def println(text):
|
|
58
|
-
_client_instance.println(text)
|
|
59
|
-
|
|
60
|
-
def show_image(x, y, path, width, height):
|
|
61
|
-
_client_instance.show_image(x, y, path, width, height)
|
|
62
|
-
|
|
63
|
-
def draw_line(x1, y1, x2, y2, color="black", width=1):
|
|
64
|
-
_client_instance.draw_line(x1, y1, x2, y2, color, width)
|
|
65
|
-
|
|
66
|
-
def fill_rect(x, y, w, h, color="black"):
|
|
67
|
-
_client_instance.fill_rect(x, y, w, h, color)
|
|
68
|
-
|
|
69
|
-
def draw_rect(x, y, w, h, width, color="black"):
|
|
70
|
-
_client_instance.draw_rect(x, y, w, h, width, color)
|
|
71
|
-
|
|
72
|
-
def fill_circle(cx, cy, r, color="black"):
|
|
73
|
-
_client_instance.fill_circle(cx, cy, r, color)
|
|
74
|
-
|
|
75
|
-
def draw_circle(cx, cy, r, width, color="black"):
|
|
76
|
-
_client_instance.draw_circle(cx, cy, r, width, color)
|
|
77
|
-
|
|
78
|
-
def clear():
|
|
79
|
-
_client_instance.clear()
|
|
80
|
-
|
|
81
|
-
def finish():
|
|
82
|
-
_client_instance.finish()
|
|
83
|
-
|
|
84
|
-
# 可选:如果希望仍然可以使用类创建新实例
|
|
85
|
-
def create_client(host="127.0.0.1", port=65167):
|
|
86
|
-
return _gui_client(host, port)
|
|
87
|
-
|
smartpi/base_driver.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
smartpi/__init__.py,sha256=
|
|
2
|
-
smartpi/
|
|
1
|
+
smartpi/__init__.py,sha256=DD3m7tPhima564oB5wb8kPTu1puPptby_1t8IlPB5d0,199
|
|
2
|
+
smartpi/_gui.py,sha256=QObbzAx3m9m7E6A0uQ0Ek_Ofb3stSl7ef96FdVpMVn4,1779
|
|
3
|
+
smartpi/base_driver.py,sha256=hJ5_Rph1BT-riYiW1pgw685WAgEMjpqDF264BLSP6hk,24392
|
|
3
4
|
smartpi/color_sensor.py,sha256=YXJjknYjp7teTZsHYZRAWgi73CH0MhBp1go9y0Inxyo,498
|
|
4
5
|
smartpi/cw2015.py,sha256=1lAF-pi_ye_ya1AZQS1sjbgsDf7MThO5IAskKsNGBzA,5695
|
|
5
6
|
smartpi/flash.py,sha256=-pUqg6FSVoBiLFKqrG9B4dFqn8lICnQsSPJr_MtZLIU,4132
|
|
6
|
-
smartpi/gui.py,sha256=HaupXWg5cWw_n86ge8IxARrvL3gpcDCNRwATK9irwH8,2960
|
|
7
7
|
smartpi/humidity.py,sha256=nZwiBtMWKNipVM83ymajZACPHxkC2vUJjDMmCOPN9lw,499
|
|
8
8
|
smartpi/led.py,sha256=flvN7EJfP6VDTSiC93w1uR8pRxcZD9w2vLXA1GbJTo8,538
|
|
9
9
|
smartpi/light_sensor.py,sha256=MayyVikWcXQfjeZrtYRnwYgHBDzu2g-mfJLpdd29EG8,1852
|
|
@@ -14,7 +14,7 @@ smartpi/temperature.py,sha256=VT79CYA41q1d_4AM-Y0eIMeIw7AtCkSXjWVws6Yx5yE,462
|
|
|
14
14
|
smartpi/touch_sensor.py,sha256=P57RRQlqY0KexpMi-ydqwF5albOKCBOGb0Rb6zeVTqk,440
|
|
15
15
|
smartpi/trace.py,sha256=tut7BMbq87ShaR5eNuv7PZtAEz9DS5_BDf0_muIZ-tQ,4577
|
|
16
16
|
smartpi/ultrasonic.py,sha256=kmVpUfvE1oHoqgv92ZU6Fi-sO6DSwm10ssKsImNeOkY,624
|
|
17
|
-
smartpi-0.1.
|
|
18
|
-
smartpi-0.1.
|
|
19
|
-
smartpi-0.1.
|
|
20
|
-
smartpi-0.1.
|
|
17
|
+
smartpi-0.1.29.dist-info/METADATA,sha256=EX2b2m3MfzrJHoX2hRGSQJhlBYMWpFuRcwPttrctwhA,311
|
|
18
|
+
smartpi-0.1.29.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
19
|
+
smartpi-0.1.29.dist-info/top_level.txt,sha256=PoLhUCmWAiQUg5UeN2fS-Y1iQyBbF2rdUlizXtpHGRQ,8
|
|
20
|
+
smartpi-0.1.29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|