Skip to content

Commit 322ab0a

Browse files
committed
Cleared Out The LIVE Script
1 parent ad44928 commit 322ab0a

File tree

3 files changed

+3
-54
lines changed

3 files changed

+3
-54
lines changed

LIVE.py

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from rich.table import Table
77
from rich import box
88
from rich.style import Style
9-
from requests import Session
10-
from signalr import Connection
119
#</editor-fold>
1210

1311
#<editor-fold desc="Set Ups">
@@ -17,52 +15,8 @@
1715
mainStyle = Style(color = "yellow")
1816
#</editor-fold>
1917

20-
def LiveTiming(username, password):
21-
#LiveTimingResults()
22-
with Session() as session:
23-
# create a connection
24-
connection = Connection("https://livetiming.formula1.com/signalr", session)
25-
26-
# get chat hub
27-
chat = connection.register_hub('chat')
28-
29-
# start a connection
30-
connection.start()
31-
32-
# create new chat message handler
33-
def print_received_message(data):
34-
print('received: ', data)
35-
36-
# create new chat topic handler
37-
def print_topic(topic, user):
38-
print('topic: ', topic, user)
39-
40-
# create error handler
41-
def print_error(error):
42-
print('error: ', error)
43-
44-
# receive new chat messages from the hub
45-
chat.client.on('newMessageReceived', print_received_message)
46-
47-
# process errors
48-
connection.error += print_error
49-
50-
# start connection, optionally can be connection.start()
51-
with connection:
52-
# post new message
53-
#chat.server.invoke('send', 'Python is here')
54-
55-
# change chat topic
56-
#chat.server.invoke('setTopic', 'Welcome python!')
57-
58-
# invoke server method that throws error
59-
#chat.server.invoke('requestError')
60-
61-
# post another message
62-
# chat.server.invoke('send', 'Bye-bye!')
63-
64-
# wait a second before exit
65-
connection.wait(1)
18+
def LiveTiming():
19+
LiveTimingResults()
6620

6721
def LiveTimingResults():
6822
# Creates A Table To Output The Results

__pycache__/LIVE.cpython-39.pyc

-899 Bytes
Binary file not shown.

main.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
parser.add_argument("-s", "--session", help = "The Session Name (E.G. R, SQ, Q, FP3, FP2, FP1)")
2828
parser.add_argument("-m", "--minisectors", help = "The Amount Of MiniSectors", type = int)
2929
parser.add_argument("-sp", "--startingpos", help = "The Drivers Starting Position", type = int)
30-
parser.add_argument("-us", "--username", help = "Your F1 Login Username")
31-
parser.add_argument("-pw", "--password", help = "Your F1 Login Password")
3230
parser.add_argument("-l", "--lap", help = "The Lap You Want To View")
3331
parser.add_argument("-sd", "--seconddriver", help = "A Second Drivers Three Letter Identifier")
3432
parser.add_argument("-v", "--verbose", help="Increase The Output Verbosity", action="store_true")
@@ -63,10 +61,7 @@
6361
else:
6462
console.print("Incorrect Arguments Inputted", style=errorStyle)
6563
elif args.mode == "LIVE":
66-
if args.username is not None and args.password is not None:
67-
LIVE.LiveTiming(args.username, args.password)
68-
else:
69-
console.print("Incorrect Arguments Inputted", style=errorStyle)
64+
LIVE.LiveTiming()
7065
elif args.mode == "LT":
7166
if args.year is not None and args.race is not None and args.session is not None and args.lap is not None:
7267
if args.seconddriver is not None:

0 commit comments

Comments
 (0)