Minor cleanup, pep8 compliance

This commit is contained in:
Ammar Askar committed 2014-10-08 22:12:37 +05:00
1 parent 85112fba1d
commit 1982716f73
5 files changed
+78 -71

No files matched your search

+10 -6
View File
@@ -1,25 +1,27 @@
import getpass
import sys
from optparse import OptionParser
import authentication
PROTOCOL_VERSION = 5
def main():
parser = OptionParser()
parser.add_option("-u", "--username", dest="username", default=None,
help="username to log in with")
help="username to log in with")
parser.add_option("-p", "--password", dest="password", default=None,
help="password to log in with")
help="password to log in with")
parser.add_option("-s", "--server", dest="server", default=None,
help="server to connect to")
help="server to connect to")
(options, args) = parser.parse_args()
if not options.username:
options.username = raw_input("Enter your username: ")
@@ -27,8 +29,9 @@ def main():
options.password = getpass.getpass("Enter your password: ")
login_response = authentication.login_to_minecraft(options.username, options.password)
from pprint import pprint # TODO: remove debug
pprint(vars(login_response)) # TODO: remove debug
from pprint import pprint # TODO: remove debug
pprint(vars(login_response)) # TODO: remove debug
if login_response.error:
print login_response.human_error
@@ -48,6 +51,7 @@ def main():
port = 25565
from network.connection import Connection
connection = Connection(address, port, login_response)
connection.status()