kopia lustrzana https://github.com/dnet/pySSTV
added Python six compatibility layer (#10)
added dependency to `six` for better Python 2/3 compatibilitypull/11/head
rodzic
7eac9636a3
commit
5d3b11a144
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
six==1.10.0
|
||||
Pillow==2.2.1
|
||||
mock==1.0.1
|
||||
nose==1.3.0
|
||||
|
|
Ładowanie…
Reference in New Issue