mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2025-02-02 04:51:23 +01:00
split up pylint into errors and warning runners
This commit is contained in:
parent
c353d8bb86
commit
d3917b42a4
@ -280,7 +280,7 @@ def _raise_from_request(req):
|
||||
Raises an appropriate `YggdrasilError` based on the `status_code` and
|
||||
`json` of a `requests.Request` object.
|
||||
"""
|
||||
if req.status_code == requests.codes.ok:
|
||||
if req.status_code == requests.codes['ok']:
|
||||
return None
|
||||
|
||||
try:
|
||||
|
@ -6,13 +6,14 @@ import socket
|
||||
import time
|
||||
import select
|
||||
|
||||
import packets
|
||||
from types import VarInt
|
||||
import encryption
|
||||
|
||||
from .types import VarInt
|
||||
from . import packets
|
||||
from .. import PROTOCOL_VERSION
|
||||
|
||||
|
||||
class ConnectionOptions(object):
|
||||
class _ConnectionOptions(object):
|
||||
# TODO: allow these options to be overriden from a constructor below
|
||||
address = None
|
||||
port = None
|
||||
@ -28,7 +29,7 @@ class Connection(object):
|
||||
_outgoing_packet_queue = deque()
|
||||
_write_lock = Lock()
|
||||
networking_thread = None
|
||||
options = ConnectionOptions()
|
||||
options = _ConnectionOptions()
|
||||
packet_listeners = []
|
||||
|
||||
# The reactor handles all the default responses to packets,
|
||||
@ -251,7 +252,6 @@ class LoginReactor(PacketReactor):
|
||||
|
||||
def react(self, packet):
|
||||
if packet.packet_name == "encryption request":
|
||||
import encryption
|
||||
|
||||
secret = encryption.generate_shared_secret()
|
||||
token, encrypted_secret = encryption.encrypt_token_and_secret(
|
||||
|
@ -120,7 +120,7 @@ class ResponsePacket(Packet):
|
||||
{'json_response': String}]
|
||||
|
||||
|
||||
class PingPacket(Packet):
|
||||
class PingPacketResponse(Packet):
|
||||
id = 0x01
|
||||
packet_name = "ping"
|
||||
definition = [
|
||||
@ -129,7 +129,7 @@ class PingPacket(Packet):
|
||||
|
||||
STATE_STATUS_CLIENTBOUND = {
|
||||
0x00: ResponsePacket,
|
||||
0x01: PingPacket
|
||||
0x01: PingPacketResponse
|
||||
}
|
||||
|
||||
|
||||
|
21
tox.ini
21
tox.ini
@ -4,7 +4,7 @@
|
||||
# and then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
envlist = py27, py33, py34, pypy, cover, flake8, pylint, verify-manifest
|
||||
envlist = py27, py33, py34, pypy, cover, flake8, pylint-errors, pylint-full, verify-manifest
|
||||
|
||||
[testenv]
|
||||
commands = nosetests
|
||||
@ -41,13 +41,26 @@ deps =
|
||||
{[testenv]deps}
|
||||
flake8
|
||||
|
||||
[testenv:pylint]
|
||||
[testenv:pylint-errors]
|
||||
basepython = python3.4
|
||||
commands =
|
||||
pylint minecraft
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
pylint
|
||||
commands = pylint minecraft -f colorized -E
|
||||
|
||||
[testenv:pylint]
|
||||
basepython = python3.4
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
pylint
|
||||
commands = pylint minecraft -f colorized -d all -e W -r n
|
||||
|
||||
[testenv:pylint-full]
|
||||
basepython = python3.4
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
pylint
|
||||
commands = pylint minecraft -f colorized --disable=E
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python3.4
|
||||
|
Loading…
Reference in New Issue
Block a user