We discussed this back in Jan and then nothing happened.

ok on the diff below to switch from python2 to python3?

This is one of the last 2 consumers of python2,-tkinter (the other 
consumer being security/oletools for which I've sent a python3 diff to 
rpointel@).


Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/snack/Makefile,v
retrieving revision 1.18
diff -u -p -u -r1.18 Makefile
--- Makefile    5 Sep 2023 16:13:42 -0000       1.18
+++ Makefile    22 Sep 2023 21:05:50 -0000
@@ -7,8 +7,8 @@ PKGNAME-main =  snack-${MODPY_EGG_VERSIO
 PKGNAME-python = py-snack-${MODPY_EGG_VERSION}
 CATEGORIES =   audio
 
-REVISION-main = 6
-REVISION-python =2
+REVISION-main = 7
+REVISION-python = 3
 
 HOMEPAGE =     http://www.speech.kth.se/snack
 SITES =                ${HOMEPAGE}/dist/
@@ -25,7 +25,6 @@ LIB_DEPENDS-main =    audio/libvorbis
 MULTI_PACKAGES =       -main -python
 
 MODULES =              lang/python x11/tk
-MODPY_VERSION =        ${MODPY_DEFAULT_VERSION_2}
 
 BUILD_DEPENDS =                ${MODTK_BUILD_DEPENDS}
 RUN_DEPENDS-main =     ${MODTK_RUN_DEPENDS}
@@ -42,8 +41,6 @@ CONFIGURE_ARGS =      --with-tcl=${MODTCL_LIB
 MAKE_FLAGS +=          SNACK_INSTALL_PATH=${MODTCL_TCLDIR}     
 
 TEST_TARGET =  test
-
-MODPY_ADJ_FILES = demos/python/*.py
 
 pre-configure:
        cp ${FILESDIR}/jkAudIO_sndio.c ${WRKSRC}/unix/
Index: patches/patch-demos_python_MinSect_py
===================================================================
RCS file: patches/patch-demos_python_MinSect_py
diff -N patches/patch-demos_python_MinSect_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_MinSect_py       22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/MinSect.py
+--- demos/python/MinSect.py.orig
++++ demos/python/MinSect.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_MinSpeg_py
===================================================================
RCS file: patches/patch-demos_python_MinSpeg_py
diff -N patches/patch-demos_python_MinSpeg_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_MinSpeg_py       22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/MinSpeg.py
+--- demos/python/MinSpeg.py.orig
++++ demos/python/MinSpeg.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_MinWave_py
===================================================================
RCS file: patches/patch-demos_python_MinWave_py
diff -N patches/patch-demos_python_MinWave_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_MinWave_py       22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/MinWave.py
+--- demos/python/MinWave.py.orig
++++ demos/python/MinWave.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_dataCmd_py
===================================================================
RCS file: patches/patch-demos_python_dataCmd_py
diff -N patches/patch-demos_python_dataCmd_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_dataCmd_py       22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,12 @@
+Index: demos/python/dataCmd.py
+--- demos/python/dataCmd.py.orig
++++ demos/python/dataCmd.py
+@@ -1,7 +1,7 @@
+ #! /usr/bin/env python
+ # -*- coding: iso-8859-1 -*-
+ 
+-import Tkinter
++import tkinter as Tkinter
+ import tkSnack
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_echo_py
===================================================================
RCS file: patches/patch-demos_python_echo_py
diff -N patches/patch-demos_python_echo_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_echo_py  22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/echo.py
+--- demos/python/echo.py.orig
++++ demos/python/echo.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_generator_py
===================================================================
RCS file: patches/patch-demos_python_generator_py
diff -N patches/patch-demos_python_generator_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_generator_py     22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/generator.py
+--- demos/python/generator.py.orig
++++ demos/python/generator.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_mixplay_py
===================================================================
RCS file: patches/patch-demos_python_mixplay_py
diff -N patches/patch-demos_python_mixplay_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_mixplay_py       22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/mixplay.py
+--- demos/python/mixplay.py.orig
++++ demos/python/mixplay.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_notescale_py
===================================================================
RCS file: patches/patch-demos_python_notescale_py
diff -N patches/patch-demos_python_notescale_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_notescale_py     22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/notescale.py
+--- demos/python/notescale.py.orig
++++ demos/python/notescale.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_oggplay_py
===================================================================
RCS file: patches/patch-demos_python_oggplay_py
diff -N patches/patch-demos_python_oggplay_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_oggplay_py       22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,18 @@
+Index: demos/python/oggplay.py
+--- demos/python/oggplay.py.orig
++++ demos/python/oggplay.py
+@@ -6,7 +6,7 @@
+ # by tkSnack
+ 
+ import sys
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ initializeSnack(Tkinter.Tk())
+@@ -19,4 +19,4 @@ if sys.argv[1:]:
+       snd = Sound(file=sys.argv[1])
+       snd.play(blocking=1)
+ else:
+-      print "Usage: oggplay.py file.ogg"
++      print("Usage: oggplay.py file.ogg")
Index: patches/patch-demos_python_playnotes_py
===================================================================
RCS file: patches/patch-demos_python_playnotes_py
diff -N patches/patch-demos_python_playnotes_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_playnotes_py     22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/playnotes.py
+--- demos/python/playnotes.py.orig
++++ demos/python/playnotes.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_polarspec_py
===================================================================
RCS file: patches/patch-demos_python_polarspec_py
diff -N patches/patch-demos_python_polarspec_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_polarspec_py     22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/polarspec.py
+--- demos/python/polarspec.py.orig
++++ demos/python/polarspec.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ from math import *
+ 
Index: patches/patch-demos_python_spectrogram_py
===================================================================
RCS file: patches/patch-demos_python_spectrogram_py
diff -N patches/patch-demos_python_spectrogram_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_spectrogram_py   22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/spectrogram.py
+--- demos/python/spectrogram.py.orig
++++ demos/python/spectrogram.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-demos_python_sphere_py
===================================================================
RCS file: patches/patch-demos_python_sphere_py
diff -N patches/patch-demos_python_sphere_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_sphere_py        22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,26 @@
+Index: demos/python/sphere.py
+--- demos/python/sphere.py.orig
++++ demos/python/sphere.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+@@ -15,11 +15,11 @@ snd = Sound()
+ 
+ file = 'test.sph'
+ 
+-print 'reading sphere file \'%s\'' % file
++print('reading sphere file \'%s\'' % file)
+ snd.read(file)
+ 
+-print 'playing file \'%s\'' % file
++print('playing file \'%s\'' % file)
+ snd.play(blocking=1)
+ 
+-print 'writing wav file \'%s\'' % file
++print('writing wav file \'%s\'' % file)
+ snd.write('new.wav')
Index: patches/patch-demos_python_tkSnack_py
===================================================================
RCS file: patches/patch-demos_python_tkSnack_py
diff -N patches/patch-demos_python_tkSnack_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_tkSnack_py       22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,57 @@
+Index: demos/python/tkSnack.py
+--- demos/python/tkSnack.py.orig
++++ demos/python/tkSnack.py
+@@ -7,7 +7,7 @@ by Kevin Russell and Kare Sjolander
+ last modified: Mar 28, 2003
+ """
+ 
+-import Tkinter
++import tkinter as Tkinter
+ import types
+ import string
+ 
+@@ -20,7 +20,6 @@ def initializeSnack(newroot):
+     Tkroot = newroot
+     Tkroot.tk.call('eval', 'package require snack')
+     Tkroot.tk.call('snack::createIcons')
+-    Tkroot.tk.call('snack::setUseOldObjAPI')
+     audio = AudioControllerSingleton()
+     mixer = MixerControllerSingleton()
+ 
+@@ -92,7 +91,7 @@ class TkObject:
+                 self.tk.call(self.name, 'configure')):
+                 cnf[x[0][1:]] = (x[0][1:],) + x[1:]
+                 return cnf
+-        if type(cnf) is types.StringType:
++        if isinstance(cnf, str):
+             x = self.tk.split(self.tk.call(self.name, 'configure', '-'+cnf))
+             return (x[0][1:],) + x[1:]
+         self.tk.call((self.name, 'configure') + self._options(cnf))
+@@ -124,8 +123,7 @@ class Sound (TkObject):
+             if Tkroot:
+                 master = Tkroot
+             else:
+-                raise RuntimeError, \
+-                      'Tk not intialized or not registered with Snack'
++                raise RuntimeError('Tk not intialized or not registered with 
Snack')
+         self.tk = master.tk
+         if not name:
+             self.name = self.tk.call(('sound',) + self._options(kw))
+@@ -261,7 +259,7 @@ class Sound (TkObject):
+         
+     def pitch(self, method=None, **kw):
+         """Returns a list of pitch values."""
+-        if method is None or method is "amdf" or method is "AMDF":
++        if method is None or method=="amdf" or method=="AMDF":
+             result = self.tk.call((self.name, 'pitch') + self._options(kw))
+             return self._getdoubles(result)
+         else:
+@@ -537,7 +535,7 @@ class SoundFrame(Tkinter.Frame):
+         self.sound.record()
+         
+     def info(self):
+-        print self.sound.info()
++        print(self.sound.info())
+         
+ def createSpectrogram(canvas, *args, **kw):
+     """Draws a spectrogram of a sound on canvas."""
Index: patches/patch-demos_python_widget_py
===================================================================
RCS file: patches/patch-demos_python_widget_py
diff -N patches/patch-demos_python_widget_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-demos_python_widget_py        22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,11 @@
+Index: demos/python/widget.py
+--- demos/python/widget.py.orig
++++ demos/python/widget.py
+@@ -1,6 +1,6 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from tkinter import *
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
Index: patches/patch-python_tkSnack_py
===================================================================
RCS file: patches/patch-python_tkSnack_py
diff -N patches/patch-python_tkSnack_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-python_tkSnack_py     22 Sep 2023 21:05:50 -0000
@@ -0,0 +1,67 @@
+Index: python/tkSnack.py
+--- python/tkSnack.py.orig
++++ python/tkSnack.py
+@@ -7,7 +7,7 @@ by Kevin Russell and Kare Sjolander
+ last modified: Mar 28, 2003
+ """
+ 
+-import Tkinter
++import tkinter as Tkinter
+ import types
+ import string
+ 
+@@ -20,7 +20,6 @@ def initializeSnack(newroot):
+     Tkroot = newroot
+     Tkroot.tk.call('eval', 'package require snack')
+     Tkroot.tk.call('snack::createIcons')
+-    Tkroot.tk.call('snack::setUseOldObjAPI')
+     audio = AudioControllerSingleton()
+     mixer = MixerControllerSingleton()
+ 
+@@ -92,7 +91,7 @@ class TkObject:
+                 self.tk.call(self.name, 'configure')):
+                 cnf[x[0][1:]] = (x[0][1:],) + x[1:]
+                 return cnf
+-        if type(cnf) is types.StringType:
++        if isinstance(cnf, str):
+             x = self.tk.split(self.tk.call(self.name, 'configure', '-'+cnf))
+             return (x[0][1:],) + x[1:]
+         self.tk.call((self.name, 'configure') + self._options(cnf))
+@@ -124,8 +123,7 @@ class Sound (TkObject):
+             if Tkroot:
+                 master = Tkroot
+             else:
+-                raise RuntimeError, \
+-                      'Tk not intialized or not registered with Snack'
++                raise RuntimeError('Tk not intialized or not registered with 
Snack')
+         self.tk = master.tk
+         if not name:
+             self.name = self.tk.call(('sound',) + self._options(kw))
+@@ -261,7 +259,7 @@ class Sound (TkObject):
+         
+     def pitch(self, method=None, **kw):
+         """Returns a list of pitch values."""
+-        if method is None or method is "amdf" or method is "AMDF":
++        if method is None or method=="amdf" or method=="AMDF":
+             result = self.tk.call((self.name, 'pitch') + self._options(kw))
+             return self._getdoubles(result)
+         else:
+@@ -409,8 +407,7 @@ class Filter(TkObject):
+         if Tkroot:
+             master = Tkroot
+         else:
+-            raise RuntimeError, \
+-                 'Tk not intialized or not registered with Snack'
++            raise RuntimeError('Tk not intialized or not registered with 
Snack')
+         self.tk = master.tk
+         self.name = self.tk.call(('snack::filter', name) + args +
+                                  self._options(kw))
+@@ -537,7 +534,7 @@ class SoundFrame(Tkinter.Frame):
+         self.sound.record()
+         
+     def info(self):
+-        print self.sound.info()
++        print(self.sound.info())
+         
+ def createSpectrogram(canvas, *args, **kw):
+     """Draws a spectrogram of a sound on canvas."""
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/audio/snack/pkg/PLIST-main,v
retrieving revision 1.2
diff -u -p -u -r1.2 PLIST-main
--- pkg/PLIST-main      11 Mar 2022 18:20:31 -0000      1.2
+++ pkg/PLIST-main      22 Sep 2023 21:05:50 -0000
@@ -1,8 +1,8 @@
-lib/libsnackstub2.2.a
+@static-lib lib/libsnackstub2.2.a
 lib/tcl/snack/
-lib/tcl/snack/libsnack.so
-lib/tcl/snack/libsnackogg.so
-lib/tcl/snack/libsound.so
+@so lib/tcl/snack/libsnack.so
+@so lib/tcl/snack/libsnackogg.so
+@so lib/tcl/snack/libsound.so
 lib/tcl/snack/pkgIndex.tcl
 lib/tcl/snack/snack.tcl
 share/doc/snack/
Index: pkg/PLIST-python
===================================================================
RCS file: /cvs/ports/audio/snack/pkg/PLIST-python,v
retrieving revision 1.3
diff -u -p -u -r1.3 PLIST-python
--- pkg/PLIST-python    11 Mar 2022 18:20:31 -0000      1.3
+++ pkg/PLIST-python    22 Sep 2023 21:05:50 -0000
@@ -1,6 +1,9 @@
-lib/python${MODPY_VERSION}/site-packages/tkSnack-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info
+lib/python${MODPY_VERSION}/site-packages/tkSnack-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
+lib/python${MODPY_VERSION}/site-packages/tkSnack-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
+lib/python${MODPY_VERSION}/site-packages/tkSnack-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt
+lib/python${MODPY_VERSION}/site-packages/tkSnack-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt
+lib/python${MODPY_VERSION}/site-packages/tkSnack-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
 lib/python${MODPY_VERSION}/site-packages/tkSnack.py
-lib/python${MODPY_VERSION}/site-packages/tkSnack.pyc
 share/doc/snack/python-man.html
 share/examples/snack/python/
 share/examples/snack/python/MinSect.py

Reply via email to