Added dependency to six for better Python 2/3 compatibility

This commit is contained in:
km4yri 2017-01-11 23:03:01 -05:00
parent b185c33fa2
commit e124435af7
4 changed files with 7 additions and 28 deletions

View file

@ -1,12 +1,6 @@
#!/usr/bin/env python
from __future__ import division
try: # python 2/3 compatibility
xrange # will fail in python 3
except NameError:
pass
else:
range = xrange
from six.moves import range
from pysstv.sstv import byte_to_freq, FREQ_BLACK, FREQ_WHITE, FREQ_VIS_START
from pysstv.grayscale import GrayscaleSSTV
from itertools import chain
@ -14,6 +8,7 @@ from itertools import chain
RED, GREEN, BLUE = range(3)
class ColorSSTV(GrayscaleSSTV):
def on_init(self):
self.pixels = self.image.load()

View file

@ -1,13 +1,7 @@
#!/usr/bin/env python
from __future__ import division
try: # python 2/3 compatibility
xrange # will fail in python 3
except NameError:
pass
else:
range = xrange
from six.moves import range
from pysstv.sstv import SSTV, byte_to_freq

View file

@ -1,24 +1,13 @@
#!/usr/bin/env python
from __future__ import division, with_statement
from six.moves import range
from six.moves import map
from six.moves import zip
from math import sin, pi
from random import random
from contextlib import closing
try:
import itertools.imap as map # python 2
except ImportError:
pass # python 3
try:
import itertools.izip as zip # python 2
except ImportError:
pass # python 3
from itertools import cycle, chain
try: # python 2/3 compatibility
xrange # will fail in python 3
except NameError:
pass
else:
range = xrange
from array import array
import wave

View file

@ -1,3 +1,4 @@
six==1.10.0
Pillow==2.2.1
mock==1.0.1
nose==1.3.0