32 lines
718 B
Python
32 lines
718 B
Python
import sys
|
|
from pathlib import Path
|
|
from pprint import pprint
|
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
|
|
import socket
|
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
|
|
import src.libsquare as sq
|
|
import src.bricksetapi as lego
|
|
|
|
print("=" * 80)
|
|
result = sock.connect_ex(('127.0.0.1', 7432))
|
|
if result == 0:
|
|
print("PORT 7432 IS IN USE")
|
|
else:
|
|
print("PORT 7432 IS AVAILABLE")
|
|
sock.close()
|
|
|
|
print("=" * 80)
|
|
print("SQUARE OBJECT FOR SET 71417:")
|
|
print("=" * 80)
|
|
oursq = sq.get_itm("71417")
|
|
pprint(oursq, width=120, depth=None)
|
|
|
|
print("\n" + "=" * 80)
|
|
print("LEGO SET INFORMATION FOR SET 71417:")
|
|
print("=" * 80)
|
|
ourlego = lego.get_set(71417)
|
|
print("=" * 80)
|
|
pprint(ourlego, width=120, depth=None)
|