Skip to content

Commit

Permalink
Fixed hanging prompt on initial run
Browse files Browse the repository at this point in the history
  • Loading branch information
MNThomson committed Mar 4, 2021
1 parent 232f595 commit 0e2c848
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ZoomBuddy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import webbrowser, requests, json, csv, sys
import webbrowser, subprocess, requests, json, csv, sys

from os import system, name, path, rename
from datetime import datetime
from time import sleep

VERSION = "1.0.4"
VERSION = "1.0.5"
URL = "https://github.com/MNThomson/ZoomBuddy"
API_URL = 'https://api.github.com/repos/mnthomson/zoombuddy/releases/latest'
Update_URL = 'https://github.com/MNThomson/ZoomBuddy/releases/latest'
Expand All @@ -30,6 +30,7 @@ def figlet():
print(" ", end ="")
print("MNThomson |___/")

#Check for updates
def update():
try:
response = requests.get(API_URL).text
Expand Down Expand Up @@ -65,6 +66,7 @@ def update():
else:
pass

#Open the ZoomData file with exceptions
def open_data():
#Open the ZoomData csv file and skip first line (since it's the formatting)
try:
Expand All @@ -90,6 +92,7 @@ def open_data():
sleep(1)
sys.exit(0)

#Automatically join a meeting that is +-15 minutes
def auto():
#Open the ZoomData
file, csvfile = open_data()
Expand All @@ -115,6 +118,7 @@ def auto():
print("No meetinges found for this time!")
manual()

#Show a popup to choose which meeting to join
def manual():
#Open the ZoomData
file, csvfile = open_data()
Expand Down Expand Up @@ -155,6 +159,7 @@ def manual():
sys.exit(1)
connect(meetingID, passWD)

#Connect to the meeting
def connect(meetingID, passWD):
if sys.platform == "linux" or sys.platform == "linux2":
Path = "/opt/zoom/zoom"
Expand All @@ -172,10 +177,13 @@ def connect(meetingID, passWD):
sys.exit(1)

#Command to join zoom meeting
command= Path + " --url=zoommtg://zoom.us/join?confno=" + meetingID + "^&pwd=" + passWD
command = Path + " --url=zoommtg://zoom.us/join?confno=" + meetingID + "^&pwd=" + passWD

#Execute command
system(command)
try:
subprocess.run(command.split(), shell=True, timeout=1)
except subprocess.TimeoutExpired:
pass
sys.exit(0)

if __name__ == "__main__":
Expand Down

0 comments on commit 0e2c848

Please sign in to comment.