Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Fixing reportUnboundVariable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ricky-davis committed Aug 13, 2020
1 parent 31828c1 commit 61a442f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion AstroLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ def start_server(self, firstLaunch=False):
executable=self.isExecutable, consolePID=self.DedicatedServer.process.pid)

# Wait for server to finish registering...
serverData = None
while not self.DedicatedServer.registered:
try:
serverData = (AstroAPI.get_server(
Expand All @@ -455,7 +456,7 @@ def start_server(self, firstLaunch=False):
if now - startTime > 15:
serverData = serverData[0]
self.DedicatedServer.registered = True
del oldLobbyIDs
oldLobbyIDs = None
self.DedicatedServer.LobbyID = serverData['LobbyID']

if self.DedicatedServer.process.poll() is not None:
Expand Down Expand Up @@ -511,6 +512,10 @@ def check_ports_free(self):
def configure_firewall(self):
if not self.launcherConfig.AdminAutoConfigureFirewall:
return
ALRule = None
ALWRule = None
ASRule = None
launcherEXEPath = None
isFirewallEnabled = os.popen(
'netsh advfirewall show currentprofile | findstr /L "State" | findstr /L "ON"').read()
if isFirewallEnabled:
Expand Down
2 changes: 1 addition & 1 deletion BuildEXE.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PyInstaller.__main__
import os
import shutil

import PyInstaller.__main__

# pyinstaller AstroLauncher.py -F --add-data "assets/*;." --icon=assets/astrolauncherlogo.ico

Expand Down
1 change: 1 addition & 0 deletions cogs/AstroDedicatedServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def get_save_file_name(self, save):
saveGamePath = r"Astro\Saved\SaveGames"
saveGamePath = os.path.join(
self.astroPath, saveGamePath)
fullName = None

if save['bHasBeenFlaggedAsCreativeModeSave']:
c = "c"
Expand Down
2 changes: 2 additions & 0 deletions cogs/AstroWebServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def __init__(self, launcher):
super().__init__(handlers, **settings)

def run(self):
certFile = None
keyFile = None
if self.launcher.launcherConfig.EnableWebServerSSL:
certFile = self.launcher.launcherConfig.SSLCertFile
keyFile = self.launcher.launcherConfig.SSLKeyFile
Expand Down
2 changes: 2 additions & 0 deletions cogs/ValidateSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def socket_server(port, secret, tcp):
serversocket.listen(1)
while 1:
# accept connections from outside
connection = None
if tcp:
connection, _client_address = serversocket.accept()
while True:
Expand Down Expand Up @@ -176,6 +177,7 @@ def socket_client(ip, port, secret, tcp):

@contextmanager
def session_scope(ip, consolePort: int):
s = None
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(5)
Expand Down

0 comments on commit 61a442f

Please sign in to comment.