Skip to content

Commit

Permalink
Remove 2.5 compatibility.
Browse files Browse the repository at this point in the history
It has no purpose since both Pythons we support have 2.7 versions widely
available. We'll probably adopt 2.7 features at some point, but there's no
rush.
  • Loading branch information
MostAwesomeDude committed Mar 25, 2011
1 parent ecad0be commit b744213
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 219 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -84,7 +84,7 @@ Planned Features
Installing
==========

Bravo currently requires Python 2.5 or any newer Python 2.x. It is known to
Bravo currently requires Python 2.6 or any newer Python 2.x. It is known to
work on CPython and PyPy. (PyPy support is currently on hiatus and will return
when numpy support returns to PyPy.)

Expand Down
3 changes: 2 additions & 1 deletion bravo/chunk.py
@@ -1,8 +1,9 @@
from itertools import product

from numpy import int8, uint8, uint32
from numpy import cast, empty, where, zeros

from bravo.blocks import blocks, glowing_blocks
from bravo.compat import product
from bravo.packets import make_packet
from bravo.utilities import pack_nibbles

Expand Down
178 changes: 0 additions & 178 deletions bravo/compat.py

This file was deleted.

1 change: 0 additions & 1 deletion bravo/plugins/build_hooks.py
@@ -1,7 +1,6 @@
from zope.interface import implements

from bravo.blocks import blocks, items
from bravo.compat import product
from bravo.entity import Chest, Sign
from bravo.ibravo import IBuildHook
from bravo.utilities import split_coords
Expand Down
4 changes: 3 additions & 1 deletion bravo/plugins/generators.py
@@ -1,11 +1,13 @@
from __future__ import division

from itertools import product
from random import randint

from numpy import array, where

from zope.interface import implements

from bravo.blocks import blocks
from bravo.compat import product
from bravo.ibravo import ITerrainGenerator
from bravo.simplex import octaves2, octaves3, reseed

Expand Down
3 changes: 1 addition & 2 deletions bravo/plugins/physics.py
@@ -1,11 +1,10 @@
from collections import defaultdict
from itertools import chain
from itertools import chain, product

from twisted.internet.task import LoopingCall
from zope.interface import implements

from bravo.blocks import blocks, items
from bravo.compat import product
from bravo.ibravo import IBuildHook, IDigHook
from bravo.spatial import Block2DSpatialDict, Block3DSpatialDict

Expand Down
3 changes: 2 additions & 1 deletion bravo/plugins/seasons.py
@@ -1,7 +1,8 @@
from itertools import product

from zope.interface import implements

from bravo.blocks import blocks
from bravo.compat import product
from bravo.ibravo import ISeason

snow_resistant = set([
Expand Down
3 changes: 2 additions & 1 deletion bravo/protocols/beta.py
@@ -1,3 +1,5 @@
from collections import namedtuple
from itertools import product
from time import time
from urlparse import urlunparse
from math import pi, sin, cos
Expand All @@ -12,7 +14,6 @@
from twisted.web.client import getPage

from bravo.blocks import blocks, items
from bravo.compat import namedtuple, product
from bravo.config import configuration
from bravo.entity import Sign
from bravo.factories.infini import InfiniClientFactory
Expand Down
4 changes: 1 addition & 3 deletions bravo/simplex.py
@@ -1,11 +1,9 @@
from __future__ import division

import math
from itertools import izip
from itertools import chain, izip, permutations
from random import Random

from bravo.compat import chain, permutations

SIZE = 2**10

edges2 = list(
Expand Down
2 changes: 1 addition & 1 deletion bravo/spatial.py
@@ -1,7 +1,7 @@
from collections import defaultdict
from itertools import product
from UserDict import DictMixin

from bravo.compat import product
from bravo.utilities import taxicab2

class SpatialDict(object, DictMixin):
Expand Down
5 changes: 3 additions & 2 deletions bravo/tests/plugins/test_generators.py
@@ -1,5 +1,7 @@
import unittest

from itertools import product

import bravo.blocks
import bravo.chunk
import bravo.ibravo
Expand All @@ -22,8 +24,7 @@ def test_boring(self):
plugin = self.p["boring"]

plugin.populate(self.chunk, 0)
for x, y, z in bravo.compat.product(xrange(16), xrange(128),
xrange(16)):
for x, y, z in product(xrange(16), xrange(128), xrange(16)):
if y < 64:
self.assertEqual(self.chunk.get_block((x, y, z)),
bravo.blocks.blocks["stone"].slot)
Expand Down
1 change: 0 additions & 1 deletion bravo/tests/test_chunk.py
Expand Up @@ -5,7 +5,6 @@
from numpy.testing import assert_array_equal

import bravo.chunk
import bravo.compat

class TestChunkBlocks(unittest.TestCase):

Expand Down
18 changes: 7 additions & 11 deletions bravo/tests/test_world.py
Expand Up @@ -3,7 +3,8 @@
import tempfile
import unittest

import bravo.compat
from itertools import product

import bravo.config
import bravo.world

Expand Down Expand Up @@ -39,8 +40,7 @@ def test_get_block(self):
dtype=numpy.uint8)
chunk.blocks.shape = (16, 16, 128)

for x, y, z in bravo.compat.product(xrange(16), xrange(128),
xrange(16)):
for x, y, z in product(xrange(16), xrange(128), xrange(16)):
# This works because the chunk is at (0, 0) so the coords don't
# need to be adjusted.
self.assertEqual(chunk.get_block((x, y, z)),
Expand All @@ -54,8 +54,7 @@ def test_get_metadata(self):
dtype=numpy.uint8)
chunk.metadata.shape = (16, 16, 128)

for x, y, z in bravo.compat.product(xrange(16), xrange(128),
xrange(16)):
for x, y, z in product(xrange(16), xrange(128), xrange(16)):
# this works because the chunk is at (0, 0) so the coords don't
# need to be adjusted.
self.assertEqual(chunk.get_metadata((x, y, z)),
Expand All @@ -76,8 +75,7 @@ def test_get_block_readback(self):
self.w.dirty_chunk_cache.clear()
chunk = self.w.load_chunk(0, 0)

for x, y, z in bravo.compat.product(xrange(16), xrange(128),
xrange(16)):
for x, y, z in product(xrange(16), xrange(128), xrange(16)):
# This works because the chunk is at (0, 0) so the coords don't
# need to be adjusted.
self.assertEqual(chunk.get_block((x, y, z)),
Expand All @@ -98,8 +96,7 @@ def test_get_block_readback_negative(self):
self.w.dirty_chunk_cache.clear()
chunk = self.w.load_chunk(-1, -1)

for x, y, z in bravo.compat.product(xrange(16), xrange(128),
xrange(16)):
for x, y, z in product(xrange(16), xrange(128), xrange(16)):
self.assertEqual(chunk.get_block((x, y, z)),
self.w.get_block((x - 16, y, z - 16)))

Expand All @@ -118,8 +115,7 @@ def test_get_metadata_readback(self):
self.w.dirty_chunk_cache.clear()
chunk = self.w.load_chunk(0, 0)

for x, y, z in bravo.compat.product(xrange(16), xrange(128),
xrange(16)):
for x, y, z in product(xrange(16), xrange(128), xrange(16)):
# this works because the chunk is at (0, 0) so the coords don't
# need to be adjusted.
self.assertEqual(chunk.get_metadata((x, y, z)),
Expand Down
2 changes: 1 addition & 1 deletion bravo/world.py
@@ -1,4 +1,5 @@
from functools import wraps
from itertools import product
import random
import sys
import weakref
Expand All @@ -12,7 +13,6 @@
from zope.interface.verify import verifyObject

from bravo.chunk import Chunk
from bravo.compat import product
from bravo.config import configuration
from bravo.entity import Player
from bravo.ibravo import ISerializer, ISerializerFactory
Expand Down
1 change: 0 additions & 1 deletion docs/auxiliary.rst
Expand Up @@ -6,6 +6,5 @@ Modules which do not contribute directly to the functionality of Bravo.

.. toctree::

compat
simplex
utilities
11 changes: 0 additions & 11 deletions docs/compat.rst

This file was deleted.

0 comments on commit b744213

Please sign in to comment.