public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alfredo Tupone" <tupone@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-tcltk/snack/files/, dev-tcltk/snack/
Date: Wed, 12 Aug 2020 11:41:01 +0000 (UTC)	[thread overview]
Message-ID: <1597232442.69bdf3174f7747beaf0ad8578553be1cbee2abb8.tupone@gentoo> (raw)

commit:     69bdf3174f7747beaf0ad8578553be1cbee2abb8
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 12 11:40:42 2020 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Wed Aug 12 11:40:42 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69bdf317

dev-tcltk/snack: porting to python3_7

Closes: https://bugs.gentoo.org/735304
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 .../snack/files/tcl-snack-2.2.10-python3.patch     | 385 +++++++++++++++++++++
 dev-tcltk/snack/snack-2.2.10-r9.ebuild             |   3 +-
 2 files changed, 387 insertions(+), 1 deletion(-)

diff --git a/dev-tcltk/snack/files/tcl-snack-2.2.10-python3.patch b/dev-tcltk/snack/files/tcl-snack-2.2.10-python3.patch
new file mode 100644
index 00000000000..63c13885b63
--- /dev/null
+++ b/dev-tcltk/snack/files/tcl-snack-2.2.10-python3.patch
@@ -0,0 +1,385 @@
+diff -up snack2.2.10/demos/python/dataCmd.py.py3 snack2.2.10/demos/python/dataCmd.py
+--- snack2.2.10/demos/python/dataCmd.py.py3	2018-10-04 15:46:14.974999306 -0400
++++ snack2.2.10/demos/python/dataCmd.py	2018-10-04 15:46:50.295216897 -0400
+@@ -1,7 +1,12 @@
+ #! /usr/bin/env python
+ # -*- coding: iso-8859-1 -*-
+ 
+-import Tkinter
++import sys
++if sys.version_info[0] == 2:
++    import Tkinter
++else:
++    import tkinter as Tkinter
++
+ import tkSnack
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/echo.py.py3 snack2.2.10/demos/python/echo.py
+--- snack2.2.10/demos/python/echo.py.py3	2018-10-04 15:46:59.535012224 -0400
++++ snack2.2.10/demos/python/echo.py	2018-10-04 15:47:37.093180236 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/generator.py.py3 snack2.2.10/demos/python/generator.py
+--- snack2.2.10/demos/python/generator.py.py3	2018-10-04 15:47:47.332953411 -0400
++++ snack2.2.10/demos/python/generator.py	2018-10-04 15:48:06.435530261 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/MinSect.py.py3 snack2.2.10/demos/python/MinSect.py
+--- snack2.2.10/demos/python/MinSect.py.py3	2018-10-04 15:48:16.444308540 -0400
++++ snack2.2.10/demos/python/MinSect.py	2018-10-04 15:48:45.907655882 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/MinSpeg.py.py3 snack2.2.10/demos/python/MinSpeg.py
+--- snack2.2.10/demos/python/MinSpeg.py.py3	2018-10-04 15:48:57.586397173 -0400
++++ snack2.2.10/demos/python/MinSpeg.py	2018-10-04 15:49:16.562976809 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/MinWave.py.py3 snack2.2.10/demos/python/MinWave.py
+--- snack2.2.10/demos/python/MinWave.py.py3	2018-10-04 15:49:26.578754945 -0400
++++ snack2.2.10/demos/python/MinWave.py	2018-10-04 15:49:39.057478518 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/mixplay.py.py3 snack2.2.10/demos/python/mixplay.py
+--- snack2.2.10/demos/python/mixplay.py.py3	2018-10-04 15:49:49.602244931 -0400
++++ snack2.2.10/demos/python/mixplay.py	2018-10-04 15:50:04.440916236 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/notescale.py.py3 snack2.2.10/demos/python/notescale.py
+--- snack2.2.10/demos/python/notescale.py.py3	2018-10-04 15:50:13.624712803 -0400
++++ snack2.2.10/demos/python/notescale.py	2018-10-04 15:50:30.640335876 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/oggplay.py.py3 snack2.2.10/demos/python/oggplay.py
+--- snack2.2.10/demos/python/oggplay.py.py3	2018-10-04 15:50:40.330121229 -0400
++++ snack2.2.10/demos/python/oggplay.py	2018-10-04 15:51:35.127907369 -0400
+@@ -5,8 +5,13 @@
+ # Note: this script will also play audio files in any other format supported
+ # by tkSnack
+ 
++from __future__ import print_function
+ import sys
+-from Tkinter import *
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ initializeSnack(Tkinter.Tk())
+@@ -19,4 +24,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")
+diff -up snack2.2.10/demos/python/playnotes.py.py3 snack2.2.10/demos/python/playnotes.py
+--- snack2.2.10/demos/python/playnotes.py.py3	2018-10-04 15:51:44.431701277 -0400
++++ snack2.2.10/demos/python/playnotes.py	2018-10-04 15:52:01.623320444 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/polarspec.py.py3 snack2.2.10/demos/python/polarspec.py
+--- snack2.2.10/demos/python/polarspec.py.py3	2018-10-04 15:52:11.479102123 -0400
++++ snack2.2.10/demos/python/polarspec.py	2018-10-04 15:52:24.654810263 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ from math import *
+ 
+diff -up snack2.2.10/demos/python/spectrogram.py.py3 snack2.2.10/demos/python/spectrogram.py
+--- snack2.2.10/demos/python/spectrogram.py.py3	2018-10-04 15:52:35.462570856 -0400
++++ snack2.2.10/demos/python/spectrogram.py	2018-10-04 15:52:49.101268729 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/demos/python/sphere.py.py3 snack2.2.10/demos/python/sphere.py
+--- snack2.2.10/demos/python/sphere.py.py3	2018-10-04 15:52:57.679078718 -0400
++++ snack2.2.10/demos/python/sphere.py	2018-10-04 15:53:36.557217499 -0400
+@@ -1,6 +1,12 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++from __future__ import print_function
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+@@ -15,11 +21,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')
+diff -up snack2.2.10/demos/python/tkSnack.py.py3 snack2.2.10/demos/python/tkSnack.py
+--- snack2.2.10/demos/python/tkSnack.py.py3	2018-10-04 15:53:45.815012427 -0400
++++ snack2.2.10/demos/python/tkSnack.py	2018-10-04 15:56:03.873998084 -0400
+@@ -7,8 +7,14 @@ by Kevin Russell and Kare Sjolander
+ last modified: Mar 28, 2003
+ """
+ 
+-import Tkinter
+-import types
++from __future__ import print_function
++
++import sys
++if sys.version_info[0] == 2:
++    import Tkinter
++else:
++    import tkinter as Tkinter
++
+ import string
+ 
+ Tkroot = None
+@@ -20,7 +26,8 @@ def initializeSnack(newroot):
+     Tkroot = newroot
+     Tkroot.tk.call('eval', 'package require snack')
+     Tkroot.tk.call('snack::createIcons')
+-    Tkroot.tk.call('snack::setUseOldObjAPI')
++    if sys.version_info[0] == 2:
++        Tkroot.tk.call('snack::setUseOldObjAPI')
+     audio = AudioControllerSingleton()
+     mixer = MixerControllerSingleton()
+ 
+@@ -92,7 +99,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 +131,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))
+@@ -409,8 +415,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 +542,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."""
+diff -up snack2.2.10/demos/python/widget.py.py3 snack2.2.10/demos/python/widget.py
+--- snack2.2.10/demos/python/widget.py.py3	2018-10-04 15:56:11.263837964 -0400
++++ snack2.2.10/demos/python/widget.py	2018-10-04 15:56:28.360467507 -0400
+@@ -1,6 +1,11 @@
+ #! /usr/bin/env python
+ 
+-from Tkinter import *
++import sys
++if sys.version_info[0] == 2:
++    from Tkinter import *
++else:
++    from tkinter import *
++
+ from tkSnack import *
+ 
+ root = Tkinter.Tk()
+diff -up snack2.2.10/python/tkSnack.py.py3 snack2.2.10/python/tkSnack.py
+--- snack2.2.10/python/tkSnack.py.py3	2018-10-04 15:56:37.537268660 -0400
++++ snack2.2.10/python/tkSnack.py	2018-10-04 15:58:47.358455670 -0400
+@@ -7,8 +7,14 @@ by Kevin Russell and Kare Sjolander
+ last modified: Mar 28, 2003
+ """
+ 
+-import Tkinter
+-import types
++from __future__ import print_function
++
++import sys
++if sys.version_info[0] == 2:
++    import Tkinter
++else:
++    import tkinter as Tkinter
++
+ import string
+ 
+ Tkroot = None
+@@ -20,7 +26,8 @@ def initializeSnack(newroot):
+     Tkroot = newroot
+     Tkroot.tk.call('eval', 'package require snack')
+     Tkroot.tk.call('snack::createIcons')
+-    Tkroot.tk.call('snack::setUseOldObjAPI')
++    if sys.version_info[0] == 2:
++        Tkroot.tk.call('snack::setUseOldObjAPI')
+     audio = AudioControllerSingleton()
+     mixer = MixerControllerSingleton()
+ 
+@@ -92,7 +99,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 +131,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))
+@@ -409,8 +415,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 +542,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."""

diff --git a/dev-tcltk/snack/snack-2.2.10-r9.ebuild b/dev-tcltk/snack/snack-2.2.10-r9.ebuild
index 8349e89b3bc..7bdbc9d8be2 100644
--- a/dev-tcltk/snack/snack-2.2.10-r9.ebuild
+++ b/dev-tcltk/snack/snack-2.2.10-r9.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python{2_7,3_7} )
 DISTUTILS_USE_SETUPTOOLS=no
 DISTUTILS_OPTIONAL=yes
 
@@ -37,6 +37,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-debian-args.patch
 	"${FILESDIR}"/${P}-test.patch
 	"${FILESDIR}"/${PN}${PV}-seektell-fix.patch
+	"${FILESDIR}"/tcl-${P}-python3.patch
 )
 
 HTML_DOCS="${WORKDIR}/${PN}${PV}/doc/*"


             reply	other threads:[~2020-08-12 11:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 11:41 Alfredo Tupone [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-20 14:37 [gentoo-commits] repo/gentoo:master commit in: dev-tcltk/snack/files/, dev-tcltk/snack/ Alfredo Tupone
2023-01-16  7:46 Alfredo Tupone
2023-01-16  7:31 Alfredo Tupone
2022-11-23  0:48 Sam James
2022-07-18  6:34 Alfredo Tupone
2020-08-12  8:43 Alfredo Tupone
2018-12-02 21:05 Alfredo Tupone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1597232442.69bdf3174f7747beaf0ad8578553be1cbee2abb8.tupone@gentoo \
    --to=tupone@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox