Merge pull request #28 from ammaraskar/six

Started using six
This commit is contained in:
Jeppe Klitgaard 2015-04-16 19:54:47 +02:00
commit f2346740ad
5 changed files with 6 additions and 20 deletions

View File

@ -3,17 +3,4 @@ This module stores code used for making pyCraft compatible with
both Python2 and Python3 while using the same codebase. both Python2 and Python3 while using the same codebase.
""" """
# Raw input -> input shenangians # Currently empty, this is sure to grow in time.
# example
# > from minecraft.compat import input
# > input("asd")
# Hi, I'm pylint, and sometimes I act silly, at which point my programmer
# overlords need to correct me.
# pylint: disable=undefined-variable,redefined-builtin,invalid-name
try:
input = raw_input
except NameError:
input = input
# pylint: enable=undefined-variable,redefined-builtin,invalid-name

View File

@ -1,2 +1,3 @@
cryptography cryptography
requests requests
six

View File

@ -6,7 +6,7 @@ from minecraft import authentication
from minecraft.exceptions import YggdrasilError from minecraft.exceptions import YggdrasilError
from minecraft.networking.connection import Connection from minecraft.networking.connection import Connection
from minecraft.networking.packets import ChatMessagePacket, ChatPacket from minecraft.networking.packets import ChatMessagePacket, ChatPacket
from minecraft.compat import input from six.moves import input
def get_options(): def get_options():

View File

@ -1,8 +1,5 @@
from minecraft import compat # noqa unused-import from minecraft import compat # noqa unused-import
import unittest import unittest # noqa unused-import
# Currently empty, eventually it should grow.
class TestCompatInput(unittest.TestCase):
def test_import_input(self):
from minecraft.compat import input # noqa unused-import

View File

@ -13,6 +13,7 @@ deps =
nose nose
requests requests
cryptography cryptography
six
[testenv:py27] [testenv:py27]
deps = deps =