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
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
try: # python 2/3 compatibility
|
from six.moves import range
|
||||||
xrange # will fail in python 3
|
|
||||||
except NameError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
range = xrange
|
|
||||||
from pysstv.sstv import byte_to_freq, FREQ_BLACK, FREQ_WHITE, FREQ_VIS_START
|
from pysstv.sstv import byte_to_freq, FREQ_BLACK, FREQ_WHITE, FREQ_VIS_START
|
||||||
from pysstv.grayscale import GrayscaleSSTV
|
from pysstv.grayscale import GrayscaleSSTV
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
@ -14,6 +8,7 @@ from itertools import chain
|
||||||
|
|
||||||
RED, GREEN, BLUE = range(3)
|
RED, GREEN, BLUE = range(3)
|
||||||
|
|
||||||
|
|
||||||
class ColorSSTV(GrayscaleSSTV):
|
class ColorSSTV(GrayscaleSSTV):
|
||||||
def on_init(self):
|
def on_init(self):
|
||||||
self.pixels = self.image.load()
|
self.pixels = self.image.load()
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
from six.moves import range
|
||||||
try: # python 2/3 compatibility
|
|
||||||
xrange # will fail in python 3
|
|
||||||
except NameError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
range = xrange
|
|
||||||
from pysstv.sstv import SSTV, byte_to_freq
|
from pysstv.sstv import SSTV, byte_to_freq
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,13 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
from __future__ import division, with_statement
|
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 math import sin, pi
|
||||||
from random import random
|
from random import random
|
||||||
from contextlib import closing
|
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
|
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
|
from array import array
|
||||||
import wave
|
import wave
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
six==1.10.0
|
||||||
Pillow==2.2.1
|
Pillow==2.2.1
|
||||||
mock==1.0.1
|
mock==1.0.1
|
||||||
nose==1.3.0
|
nose==1.3.0
|
||||||
|
|
Ładowanie…
Reference in New Issue