added Python six compatibility layer (#10)

added dependency to `six` for better Python 2/3 compatibility
pull/11/head
KM4YRI 2017-01-12 04:49:13 -05:00 zatwierdzone przez András Veres-Szentkirályi
rodzic 7eac9636a3
commit 5d3b11a144
4 zmienionych plików z 7 dodań i 28 usunięć

Wyświetl plik

@ -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()

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

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