Browse Source

Cleanup

- PEP-8: spaces should be used for indentation
- "is" should be used for comparing with "None"
- corrected indentation of "self.connected = False"
pull/1128/head
Marvin Lehmann 9 years ago
parent
commit
e4c09f6f8f
  1. 5
      lgsm/functions/gsquery.py

5
lgsm/functions/gsquery.py

@ -9,6 +9,7 @@ import optparse
import socket
import sys
class GameServer:
def __init__(self, options, arguments):
self.option = options
@ -19,7 +20,6 @@ class GameServer:
#
if self.option.engine == 'avalanche':
self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
elif self.option.engine == 'goldsource':
self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
elif self.option.engine == 'idtech3':
@ -71,7 +71,7 @@ class GameServer:
self.fatal_error('Unable to receive', 2)
connection.close()
# Response.
if self.response == None:
if self.response is None:
self.fatal_error('No response', 3)
if len(self.response) < 10:
sys.exit('Short response.', 3)
@ -84,6 +84,7 @@ class GameServer:
if not self.option.port:
self.fatal_error('No port supplied.', 4)
if __name__ == '__main__':
parser = optparse.OptionParser(
usage='usage: python %prog [options]',

Loading…
Cancel
Save