Skip to content

Commit 7f327aa

Browse files
authored
Merge pull request odwdinc#8 from odwdinc/testing
Testing
2 parents 32131a0 + 2769615 commit 7f327aa

19 files changed

+1004
-425
lines changed

.github/workflows/test-and-build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Test and Publish
2-
on: push
2+
on:
3+
push:
4+
branches:
5+
- master
36

47
jobs:
58
test:

ESP32_Client_[WIP].py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,45 @@
88

99

1010
def do_connect():
11-
wlan = network.WLAN(network.STA_IF)
12-
wlan.active(True)
13-
if not wlan.isconnected():
14-
print('connecting to network...')
15-
wlan.connect('<your ID>', '<your pass>')
16-
while not wlan.isconnected():
17-
pass
18-
print('network config:', wlan.ifconfig())
11+
wlan = network.WLAN(network.STA_IF)
12+
wlan.active(True)
13+
if not wlan.isconnected():
14+
print('connecting to network...')
15+
wlan.connect('<your ID>', '<your pass>')
16+
while not wlan.isconnected():
17+
pass
18+
print('network config:', wlan.ifconfig())
1919

2020

2121
def http_get(url):
22-
_, _, host, path = url.split('/', 3)
23-
addr = socket.getaddrinfo(host, 5000)[0][-1]
24-
s = socket.socket()
25-
s.connect(addr)
26-
s.send(bytes('GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' % (path, host), 'utf8'))
27-
while True:
28-
data = s.recv(100)
29-
if data:
30-
print(str(data, 'utf8'), end='')
31-
else:
32-
break
33-
s.close()
22+
_, _, host, path = url.split('/', 3)
23+
addr = socket.getaddrinfo(host, 5000)[0][-1]
24+
s = socket.socket()
25+
s.connect(addr)
26+
s.send(bytes('GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' % (path, host), 'utf8'))
27+
while True:
28+
data = s.recv(100)
29+
if data:
30+
print(str(data, 'utf8'), end='')
31+
else:
32+
break
33+
s.close()
3434

3535

3636
def http_put(url, body):
37-
_, _, host, path = url.split('/', 3)
38-
addr = socket.getaddrinfo(host, 5000)[0][-1]
39-
s = socket.socket()
40-
s.connect(addr)
41-
s.send(bytes('PUT /%s HTTP/1.0\r\nHost: %s\r\nContent-Type: application/json\r\nContent-Length: %d\r\n\r\n%s' %
42-
(path, host, len(body), body), 'utf8'))
43-
while True:
44-
data = s.recv(100)
45-
if data:
46-
print(str(data, 'utf8'), end='')
47-
else:
48-
break
49-
s.close()
37+
_, _, host, path = url.split('/', 3)
38+
addr = socket.getaddrinfo(host, 5000)[0][-1]
39+
s = socket.socket()
40+
s.connect(addr)
41+
s.send(bytes('PUT /%s HTTP/1.0\r\nHost: %s\r\nContent-Type: application/json\r\nContent-Length: %d\r\n\r\n%s' %
42+
(path, host, len(body), body), 'utf8'))
43+
while True:
44+
data = s.recv(100)
45+
if data:
46+
print(str(data, 'utf8'), end='')
47+
else:
48+
break
49+
s.close()
5050

5151

5252
do_connect()

Pipfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ verify_ssl = true
55

66
[dev-packages]
77
pytest-cov = "*"
8+
pylint = "*"
9+
black = "*"
810

911
[packages]
1012
flask = "*"
1113

1214
[requires]
1315
python_version = "3.8"
16+
17+
[pipenv]
18+
allow_prereleases = true

Pipfile.lock

Lines changed: 163 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![PyPI version](https://badge.fury.io/py/https%3A%2F%2Fpypi.org%2Fproject%2FSimConnect%2F.svg)](https://badge.fury.io/py/https%3A%2F%2Fpypi.org%2Fproject%2FSimConnect%2F)
2+
13
# Python-SimConnect
24

35
Python interface for MSFS2020 SimConnect.dll

SimConnect/AsyncSimConnect.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)