PySSTV 0.5.4__tar.gz → 0.5.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {PySSTV-0.5.4 → PySSTV-0.5.5}/PKG-INFO +3 -7
  2. {PySSTV-0.5.4 → PySSTV-0.5.5}/PySSTV.egg-info/PKG-INFO +3 -7
  3. {PySSTV-0.5.4 → PySSTV-0.5.5}/PySSTV.egg-info/SOURCES.txt +2 -14
  4. {PySSTV-0.5.4 → PySSTV-0.5.5}/PySSTV.egg-info/entry_points.txt +0 -1
  5. {PySSTV-0.5.4 → PySSTV-0.5.5}/README.md +1 -3
  6. PySSTV-0.5.5/pyproject.toml +3 -0
  7. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/codegen.py +16 -16
  8. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/gimp-plugin.py +8 -8
  9. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/pyaudio_sstv.py +1 -1
  10. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/repeater.py +4 -4
  11. {PySSTV-0.5.4 → PySSTV-0.5.5}/setup.py +1 -1
  12. PySSTV-0.5.4/.gitignore +0 -1
  13. PySSTV-0.5.4/.travis.yml +0 -9
  14. PySSTV-0.5.4/pysstv/examples/codeman.c +0 -25
  15. PySSTV-0.5.4/pysstv/tests/assets/320x256.png +0 -0
  16. PySSTV-0.5.4/pysstv/tests/assets/MartinM1_encode_line_lena1.p +0 -2894
  17. PySSTV-0.5.4/pysstv/tests/assets/MartinM1_encode_line_lena10.p +0 -2894
  18. PySSTV-0.5.4/pysstv/tests/assets/MartinM1_encode_line_lena100.p +0 -2894
  19. PySSTV-0.5.4/pysstv/tests/assets/MartinM1_freq_bits.p +0 -3002
  20. PySSTV-0.5.4/pysstv/tests/assets/MartinM1_freq_bits_lena.p +0 -3002
  21. PySSTV-0.5.4/pysstv/tests/assets/MartinM1_values.p +0 -1002
  22. PySSTV-0.5.4/pysstv/tests/assets/SSTV_gen_samples.p +0 -1002
  23. PySSTV-0.5.4/pysstv/tests/assets/SSTV_gen_values.p +0 -1002
  24. PySSTV-0.5.4/requirements.txt +0 -3
  25. {PySSTV-0.5.4 → PySSTV-0.5.5}/LICENSE.txt +0 -0
  26. {PySSTV-0.5.4 → PySSTV-0.5.5}/MANIFEST.in +0 -0
  27. {PySSTV-0.5.4 → PySSTV-0.5.5}/PySSTV.egg-info/dependency_links.txt +0 -0
  28. {PySSTV-0.5.4 → PySSTV-0.5.5}/PySSTV.egg-info/requires.txt +0 -0
  29. {PySSTV-0.5.4 → PySSTV-0.5.5}/PySSTV.egg-info/top_level.txt +0 -0
  30. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/__init__.py +0 -0
  31. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/__main__.py +0 -0
  32. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/color.py +0 -0
  33. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/__init__.py +0 -0
  34. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/get_floats.py +0 -0
  35. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/get_freq_bits.py +0 -0
  36. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/examples/overlay.py +0 -0
  37. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/grayscale.py +0 -0
  38. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/sstv.py +0 -0
  39. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/tests/__init__.py +0 -0
  40. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/tests/common.py +0 -0
  41. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/tests/test_color.py +0 -0
  42. {PySSTV-0.5.4 → PySSTV-0.5.5}/pysstv/tests/test_sstv.py +0 -0
  43. {PySSTV-0.5.4 → PySSTV-0.5.5}/setup.cfg +0 -0
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySSTV
3
- Version: 0.5.4
3
+ Version: 0.5.5
4
4
  Summary: Python classes for generating Slow-scan Television transmissions
5
5
  Home-page: https://github.com/dnet/pySSTV
6
6
  Author: András Veres-Szentkirályi
7
7
  Author-email: vsza@vsza.hu
8
8
  License: MIT
9
9
  Keywords: HAM SSTV slow-scan television Scottie Martin Robot Pasokon
10
- Platform: UNKNOWN
11
10
  Classifier: Development Status :: 4 - Beta
12
11
  Classifier: Topic :: Communications :: Ham Radio
13
12
  Classifier: Topic :: Multimedia :: Video :: Conversion
@@ -15,12 +14,11 @@ Classifier: License :: OSI Approved :: MIT License
15
14
  Classifier: Operating System :: OS Independent
16
15
  Description-Content-Type: text/markdown
17
16
  License-File: LICENSE.txt
17
+ Requires-Dist: Pillow
18
18
 
19
19
  SSTV generator in pure Python
20
20
  =============================
21
21
 
22
- [![Build Status](https://travis-ci.org/dnet/pySSTV.svg?branch=master)](https://travis-ci.org/dnet/pySSTV)
23
-
24
22
  PySSTV generates SSTV modulated WAV files from any image that PIL can open
25
23
  (PNG, JPEG, GIF, and many others). These WAV files then can be played by any
26
24
  audio player connected to a shortwave radio for example.
@@ -94,6 +92,4 @@ Dependencies
94
92
  ------------
95
93
 
96
94
  - Python 3.5 or later
97
- - Python Imaging Library (Debian/Ubuntu package: `python-imaging`)
98
-
99
-
95
+ - Python Imaging Library (Debian/Ubuntu package: `python3-pil`)
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySSTV
3
- Version: 0.5.4
3
+ Version: 0.5.5
4
4
  Summary: Python classes for generating Slow-scan Television transmissions
5
5
  Home-page: https://github.com/dnet/pySSTV
6
6
  Author: András Veres-Szentkirályi
7
7
  Author-email: vsza@vsza.hu
8
8
  License: MIT
9
9
  Keywords: HAM SSTV slow-scan television Scottie Martin Robot Pasokon
10
- Platform: UNKNOWN
11
10
  Classifier: Development Status :: 4 - Beta
12
11
  Classifier: Topic :: Communications :: Ham Radio
13
12
  Classifier: Topic :: Multimedia :: Video :: Conversion
@@ -15,12 +14,11 @@ Classifier: License :: OSI Approved :: MIT License
15
14
  Classifier: Operating System :: OS Independent
16
15
  Description-Content-Type: text/markdown
17
16
  License-File: LICENSE.txt
17
+ Requires-Dist: Pillow
18
18
 
19
19
  SSTV generator in pure Python
20
20
  =============================
21
21
 
22
- [![Build Status](https://travis-ci.org/dnet/pySSTV.svg?branch=master)](https://travis-ci.org/dnet/pySSTV)
23
-
24
22
  PySSTV generates SSTV modulated WAV files from any image that PIL can open
25
23
  (PNG, JPEG, GIF, and many others). These WAV files then can be played by any
26
24
  audio player connected to a shortwave radio for example.
@@ -94,6 +92,4 @@ Dependencies
94
92
  ------------
95
93
 
96
94
  - Python 3.5 or later
97
- - Python Imaging Library (Debian/Ubuntu package: `python-imaging`)
98
-
99
-
95
+ - Python Imaging Library (Debian/Ubuntu package: `python3-pil`)
@@ -1,9 +1,7 @@
1
- .gitignore
2
- .travis.yml
3
1
  LICENSE.txt
4
2
  MANIFEST.in
5
3
  README.md
6
- requirements.txt
4
+ pyproject.toml
7
5
  setup.py
8
6
  PySSTV.egg-info/PKG-INFO
9
7
  PySSTV.egg-info/SOURCES.txt
@@ -18,7 +16,6 @@ pysstv/grayscale.py
18
16
  pysstv/sstv.py
19
17
  pysstv/examples/__init__.py
20
18
  pysstv/examples/codegen.py
21
- pysstv/examples/codeman.c
22
19
  pysstv/examples/get_floats.py
23
20
  pysstv/examples/get_freq_bits.py
24
21
  pysstv/examples/gimp-plugin.py
@@ -28,13 +25,4 @@ pysstv/examples/repeater.py
28
25
  pysstv/tests/__init__.py
29
26
  pysstv/tests/common.py
30
27
  pysstv/tests/test_color.py
31
- pysstv/tests/test_sstv.py
32
- pysstv/tests/assets/320x256.png
33
- pysstv/tests/assets/MartinM1_encode_line_lena1.p
34
- pysstv/tests/assets/MartinM1_encode_line_lena10.p
35
- pysstv/tests/assets/MartinM1_encode_line_lena100.p
36
- pysstv/tests/assets/MartinM1_freq_bits.p
37
- pysstv/tests/assets/MartinM1_freq_bits_lena.p
38
- pysstv/tests/assets/MartinM1_values.p
39
- pysstv/tests/assets/SSTV_gen_samples.p
40
- pysstv/tests/assets/SSTV_gen_values.p
28
+ pysstv/tests/test_sstv.py
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  pysstv = pysstv.__main__:main
3
-
@@ -1,8 +1,6 @@
1
1
  SSTV generator in pure Python
2
2
  =============================
3
3
 
4
- [![Build Status](https://travis-ci.org/dnet/pySSTV.svg?branch=master)](https://travis-ci.org/dnet/pySSTV)
5
-
6
4
  PySSTV generates SSTV modulated WAV files from any image that PIL can open
7
5
  (PNG, JPEG, GIF, and many others). These WAV files then can be played by any
8
6
  audio player connected to a shortwave radio for example.
@@ -76,4 +74,4 @@ Dependencies
76
74
  ------------
77
75
 
78
76
  - Python 3.5 or later
79
- - Python Imaging Library (Debian/Ubuntu package: `python-imaging`)
77
+ - Python Imaging Library (Debian/Ubuntu package: `python3-pil`)
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
@@ -69,10 +69,10 @@ def main(sstv_class=None):
69
69
  n += 1
70
70
  del lut
71
71
  m_start, m_len = gen_matches(same_as, history, n)
72
- for i in xrange(same_as[m_start]):
72
+ for i in range(same_as[m_start]):
73
73
  yield history[i][0]
74
74
  yield 'for (int row = 0; row < width * {0}; row += width) {{'.format(sstv.HEIGHT)
75
- for i in xrange(same_as[m_start], same_as[m_start] + m_len - 1):
75
+ for i in range(same_as[m_start], same_as[m_start] + m_len - 1):
76
76
  yield ' ' + history[i][1]
77
77
  yield '}'
78
78
  yield '}}\n\n#define FREQ_COUNT {0}'.format(n)
@@ -83,7 +83,7 @@ def gen_matches(same_as, history, n):
83
83
  cur_start = None
84
84
  cur_len = None
85
85
  cur_end = None
86
- for i in xrange(n):
86
+ for i in range(n):
87
87
  if cur_start is None:
88
88
  tmp = same_as.get(i)
89
89
  if tmp is not None:
@@ -114,22 +114,22 @@ def test(img_file):
114
114
  import struct
115
115
  exe = './codegen-test-executable'
116
116
  if not path.exists('stb_image.h'):
117
- from urllib import urlretrieve
117
+ from urllib.request import urlretrieve
118
118
  urlretrieve('https://raw.githubusercontent.com/nothings/stb/master/stb_image.h', 'stb_image.h')
119
119
  try:
120
120
  for sstv_class in supported:
121
- print 'Testing', sstv_class
121
+ print('Testing', sstv_class)
122
122
  gcc = Popen(['gcc', '-xc', '-lm', '-o', exe, '-'], stdin=PIPE)
123
123
  start = datetime.now()
124
124
  with open(path.join(path.dirname(__file__), 'codeman.c')) as cm:
125
125
  c_src = cm.read().replace('#include "codegen.c"', '\n'.join(main(sstv_class)))
126
126
  gcc.communicate(c_src)
127
127
  gen_elapsed = datetime.now() - start
128
- print ' - gengcc took', gen_elapsed
128
+ print(' - gengcc took', gen_elapsed)
129
129
  start = datetime.now()
130
130
  gen = check_output([exe, img_file])
131
131
  native_elapsed = datetime.now() - start
132
- print ' - native took', native_elapsed
132
+ print(' - native took', native_elapsed)
133
133
  img = Image.open(img_file)
134
134
  sstv = sstv_class(img, 44100, 16)
135
135
  start = datetime.now()
@@ -138,20 +138,20 @@ def test(img_file):
138
138
  assert gen[n * 8:(n + 1) * 8] == struct.pack('ff', freq, msec)
139
139
  except AssertionError:
140
140
  mode_name = sstv_class.__name__
141
- with file('/tmp/{0}-c.bin'.format(mode_name), 'wb') as f:
141
+ with open('/tmp/{0}-c.bin'.format(mode_name), 'wb') as f:
142
142
  f.write(gen)
143
- with file('/tmp/{0}-py.bin'.format(mode_name), 'wb') as f:
143
+ with open('/tmp/{0}-py.bin'.format(mode_name), 'wb') as f:
144
144
  for n, (freq, msec) in enumerate(sstv.gen_freq_bits()):
145
145
  f.write(struct.pack('ff', freq, msec))
146
- with file('/tmp/{0}.c'.format(mode_name), 'w') as f:
146
+ with open('/tmp/{0}.c'.format(mode_name), 'w') as f:
147
147
  f.write(c_src)
148
- print (" ! Outputs are different, they've been saved to "
148
+ print((" ! Outputs are different, they've been saved to "
149
149
  "/tmp/{0}-{{c,py}}.bin, along with the C source code "
150
- "in /tmp/{0}.c").format(mode_name)
150
+ "in /tmp/{0}.c").format(mode_name))
151
151
  python_elapsed = datetime.now() - start
152
- print ' - python took', python_elapsed
153
- print ' - speedup:', python_elapsed.total_seconds() / native_elapsed.total_seconds()
154
- print 'OK'
152
+ print(' - python took', python_elapsed)
153
+ print(' - speedup:', python_elapsed.total_seconds() / native_elapsed.total_seconds())
154
+ print('OK')
155
155
  finally:
156
156
  try:
157
157
  remove(exe)
@@ -164,4 +164,4 @@ if __name__ == '__main__':
164
164
  if len(argv) > 2 and argv[1] == 'test':
165
165
  test(argv[2])
166
166
  else:
167
- print '\n'.join(main())
167
+ print('\n'.join(main()))
@@ -6,13 +6,13 @@
6
6
 
7
7
  from gimpfu import register, main, pdb, PF_BOOL, PF_STRING, PF_RADIO, CLIP_TO_IMAGE
8
8
  from PIL import Image, ImageTk
9
- from Tkinter import Tk, Canvas, Button, Checkbutton, IntVar, Frame, LEFT, NW
9
+ from tkinter import Tk, Canvas, Button, Checkbutton, IntVar, Frame, LEFT, NW
10
10
  from pysstv import __main__ as pysstv_main
11
11
  from pysstv.examples.pyaudio_sstv import PyAudioSSTV
12
12
  from pysstv.sstv import SSTV
13
13
  from itertools import repeat
14
14
  from threading import Thread
15
- from Queue import Queue, Empty
15
+ from queue import Queue, Empty
16
16
  from time import sleep
17
17
  import gimp, os
18
18
 
@@ -118,12 +118,12 @@ class ProgressCanvas(Canvas):
118
118
  self.height_ratio = 1
119
119
  width, height = image.size
120
120
  pixels = image.load()
121
- RED, GREEN, BLUE = range(3)
121
+ RED, GREEN, BLUE = list(range(3))
122
122
  self.colors = ['#{0:02x}{1:02x}{2:02x}'.format(
123
- contrast(sum(pixels[x, y][RED] for x in xrange(width)) / width),
124
- contrast(sum(pixels[x, y][GREEN] for x in xrange(width)) / width),
125
- contrast(sum(pixels[x, y][BLUE] for x in xrange(width)) / width))
126
- for y in xrange(height)]
123
+ contrast(sum(pixels[x, y][RED] for x in range(width)) / width),
124
+ contrast(sum(pixels[x, y][GREEN] for x in range(width)) / width),
125
+ contrast(sum(pixels[x, y][BLUE] for x in range(width)) / width))
126
+ for y in range(height)]
127
127
  if height / float(width) > 1.5:
128
128
  width *= 2
129
129
  elif width < 200:
@@ -237,7 +237,7 @@ register(
237
237
  "*",
238
238
  [
239
239
  (PF_RADIO, "mode", "SSTV mode", "MartinM1",
240
- tuple((n, n) for n in sorted(MODULE_MAP.iterkeys()))),
240
+ tuple((n, n) for n in sorted(MODULE_MAP.keys()))),
241
241
  (PF_BOOL, "vox", "Include VOX tones", True),
242
242
  (PF_STRING, "fskid", "FSK ID", ""),
243
243
  (PF_RADIO, "ptt_port", "PTT port", None,
@@ -5,7 +5,7 @@ Demonstrates playing the generated samples directly using PyAudio
5
5
  Tested on PyAudio 0.2.7 http://people.csail.mit.edu/hubert/pyaudio/
6
6
  """
7
7
 
8
- from __future__ import division
8
+
9
9
  from pysstv.sstv import SSTV
10
10
  from time import sleep
11
11
  from itertools import islice
@@ -8,9 +8,9 @@ simply copying/linking images to the directory or suing an SSTV
8
8
  receiver such as slowrx or QSSTV.
9
9
  """
10
10
 
11
- from __future__ import print_function
11
+
12
12
  from pyinotify import WatchManager, Notifier, ProcessEvent, IN_CREATE
13
- from pyaudio_sstv import PyAudioSSTV
13
+ from .pyaudio_sstv import PyAudioSSTV
14
14
  from pysstv.color import MartinM1, MartinM2, ScottieS1, ScottieS2
15
15
  from pysstv.grayscale import Robot8BW, Robot24BW
16
16
  from PIL import Image
@@ -44,13 +44,13 @@ class EventHandler(ProcessEvent):
44
44
 
45
45
  def get_module_for_filename(filename):
46
46
  basename, _ = path.splitext(path.basename(filename))
47
- for mode, module in MODE_MAP.iteritems():
47
+ for mode, module in MODE_MAP.items():
48
48
  if mode in basename:
49
49
  return module
50
50
 
51
51
  def get_module_for_image(image):
52
52
  size = image.size
53
- for mode in MODE_MAP.itervalues():
53
+ for mode in MODE_MAP.values():
54
54
  if all(i >= m for i, m in zip(size, (mode.WIDTH, mode.HEIGHT))):
55
55
  return mode
56
56
 
@@ -4,7 +4,7 @@ from setuptools import setup
4
4
 
5
5
  setup(
6
6
  name='PySSTV',
7
- version='0.5.4',
7
+ version='0.5.5',
8
8
  description='Python classes for generating Slow-scan Television transmissions',
9
9
  author=u'András Veres-Szentkirályi',
10
10
  author_email='vsza@vsza.hu',
PySSTV-0.5.4/.gitignore DELETED
@@ -1 +0,0 @@
1
- stb_image.h
PySSTV-0.5.4/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: python
2
- python:
3
- - "3.6"
4
- - "3.7"
5
- - "3.8"
6
- - "3.9"
7
- sudo: false
8
- install: "pip install -r requirements.txt"
9
- script: nosetests
@@ -1,25 +0,0 @@
1
- #include <stdio.h>
2
-
3
- #define STB_IMAGE_IMPLEMENTATION
4
- #include "stb_image.h"
5
- #include "codegen.c"
6
-
7
- int main(int argc, char **argv) {
8
- int x, y, n;
9
- unsigned char *img = stbi_load(argv[1], &x, &y, &n, 0);
10
- if (n != 3) {
11
- fprintf(stderr, "Only RGB images are supported\n");
12
- return 1;
13
- }
14
-
15
- float freqs[FREQ_COUNT], msecs[FREQ_COUNT];
16
-
17
- convert(img, freqs, msecs, x);
18
-
19
- for (int i = 0; i < FREQ_COUNT; i++) {
20
- fwrite(&(freqs[i]), 4, 1, stdout);
21
- fwrite(&(msecs[i]), 4, 1, stdout);
22
- }
23
-
24
- return 0;
25
- }