From ac6f9ea74dd542c9ec5dc649b0241c768d39bd4c Mon Sep 17 00:00:00 2001 From: Antonio Trande Date: Jan 13 2023 19:56:00 +0000 Subject: Release 2.1.1 --- diff --git a/.gitignore b/.gitignore index b737591..c1570b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ Pmw.1.3.2.tar.gz /Pmw-2.0.0.tar.gz +/Pmw-2.1.1.tar.gz diff --git a/python-pmw-PmwMenuBar.py.patch b/python-pmw-PmwMenuBar.py.patch deleted file mode 100644 index 612b248..0000000 --- a/python-pmw-PmwMenuBar.py.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- Pmw.1.3.2/src/Pmw/Pmw_1_3/lib/PmwMenuBar.py.debug 2007-08-08 04:55:54.000000000 +0900 -+++ Pmw.1.3.2/src/Pmw/Pmw_1_3/lib/PmwMenuBar.py 2009-05-13 18:59:22.000000000 +0900 -@@ -187,7 +187,9 @@ - menubutton = self.component(menuName + '-button') - underline = string.atoi(str(menubutton.cget('underline'))) - if underline != -1: -- label = str(menubutton.cget(textKey)) -+ label = menubutton.cget(textKey) -+ if type(label) != types.UnicodeType: -+ label = str(label) - if underline < len(label): - hotkey = string.lower(label[underline]) - if hotkey not in hotkeyList: -@@ -201,7 +203,9 @@ - underline = string.atoi( - str(menu.entrycget(item, 'underline'))) - if underline != -1: -- label = str(menu.entrycget(item, textKey)) -+ label = menu.entrycget(item, textKey) -+ if type(label) != types.UnicodeType: -+ label = str(label) - if underline < len(label): - hotkey = string.lower(label[underline]) - if hotkey not in hotkeyList: diff --git a/python-pmw-fix_identation_error.patch b/python-pmw-fix_identation_error.patch new file mode 100644 index 0000000..1e670ce --- /dev/null +++ b/python-pmw-fix_identation_error.patch @@ -0,0 +1,333 @@ +--- a/Pmw/Pmw_2_1_1/doc/example.orig.py 2022-06-23 16:54:50.004934300 +0200 ++++ b/Pmw/Pmw_2_1_1/doc/example.py 2023-01-11 21:14:32.093645279 +0100 +@@ -1,79 +1,81 @@ +-import tkinter ++import tkinter + import Pmw +- ++ ++ + class ThresholdScale(Pmw.MegaWidget): + """ Megawidget containing a scale and an indicator. + """ +- +- def __init__(self, parent = None, **kw): ++ ++ def __init__(self, parent=None, **kw): + + # Define the megawidget options. + optiondefs = ( +- ('colors', ('green', 'red'), None), +- ('threshold', 50, None), +- ('value', None, Pmw.INITOPT), ++ ('colors', ('green', 'red'), None), ++ ('threshold', 50, None), ++ ('value', None, Pmw.INITOPT), + ) + self.defineoptions(kw, optiondefs) +- ++ + # Initialise base class (after defining options). + Pmw.MegaWidget.__init__(self, parent) +- ++ + # Create the components. + interior = self.interior() +- ++ + # Create the indicator component. + self.indicator = self.createcomponent('indicator', +- (), None, +- tkinter.Frame, interior, +- width = 16, +- height = 16, +- borderwidth = 2, +- relief = 'raised') ++ (), None, ++ tkinter.Frame, interior, ++ width=16, ++ height=16, ++ borderwidth=2, ++ relief='raised') + self.indicator.grid() +- ++ + # Create the scale component. + self.scale = self.createcomponent('scale', +- (), None, +- tkinter.Scale, interior, +- command = self._doCommand, +- tickinterval = 20, +- length = 200, +- from_ = 100, +- to = 0, +- showvalue = 0) ++ (), None, ++ tkinter.Scale, interior, ++ command=self._doCommand, ++ tickinterval=20, ++ length=200, ++ from_=100, ++ to=0, ++ showvalue=0) + self.scale.grid() +- ++ + value = self['value'] + if value is not None: + self.scale.set(value) +- ++ + # Check keywords and initialise options. + self.initialiseoptions() + + def _doCommand(self, valueStr): +- if self.scale.get() > self['threshold']: +- color = self['colors'][1] +- else: +- color = self['colors'][0] +- self.indicator.configure(background = color) ++ if self.scale.get() > self['threshold']: ++ color = self['colors'][1] ++ else: ++ color = self['colors'][0] ++ self.indicator.configure(background=color) ++ + + Pmw.forwardmethods(ThresholdScale, tkinter.Scale, 'scale') +- ++ + # Initialise tkinter and Pmw. + root = Pmw.initialise() + root.title('Pmw ThresholdScale demonstration') + + # Create and pack two ThresholdScale megawidgets. + mega1 = ThresholdScale() +-mega1.pack(side = 'left', padx = 10, pady = 10) ++mega1.pack(side='left', padx=10, pady=10) + + mega2 = ThresholdScale( +- colors = ('green', 'yellow'), +- threshold = 75, +- value = 80, +- indicator_width = 32, +- scale_width = 25) +-mega2.pack(side = 'left', padx = 10, pady = 10) ++ colors=('green', 'yellow'), ++ threshold=75, ++ value=80, ++ indicator_width=32, ++ scale_width=25) ++mega2.pack(side='left', padx=10, pady=10) + + # Let's go. + root.mainloop() +--- a/Pmw/Pmw_2_1_1/doc/exercises.orig.py 2022-06-23 16:54:50.004934300 +0200 ++++ b/Pmw/Pmw_2_1_1/doc/exercises.py 2023-01-11 21:15:20.873804924 +0100 +@@ -1,123 +1,125 @@ +-import tkinter ++import tkinter + import Pmw +- ++ ++ + class ThresholdScale(Pmw.MegaWidget): + """ Megawidget containing a scale and an indicator. + """ +- +- def __init__(self, parent = None, **kw): ++ ++ def __init__(self, parent=None, **kw): + # Define the megawidget options. + optiondefs = ( +- ('colors', ('green', 'red'), None), +- ('orient', 'vertical', Pmw.INITOPT), +- ('labelmargin', 0, Pmw.INITOPT), +- ('labelpos', None, Pmw.INITOPT), +- ('threshold', (50,), None), +- ('value', None, Pmw.INITOPT), ++ ('colors', ('green', 'red'), None), ++ ('orient', 'vertical', Pmw.INITOPT), ++ ('labelmargin', 0, Pmw.INITOPT), ++ ('labelpos', None, Pmw.INITOPT), ++ ('threshold', (50,), None), ++ ('value', None, Pmw.INITOPT), + ) + self.defineoptions(kw, optiondefs) +- ++ + # Initialise base class (after defining options). + Pmw.MegaWidget.__init__(self, parent) +- ++ + # Create the components. + interior = self.interior() +- ++ + # Create the indicator component. + self.indicator = self.createcomponent('indicator', +- (), None, +- tkinter.Frame, interior, +- width = 16, +- height = 16, +- borderwidth = 2, +- relief = 'raised') +- ++ (), None, ++ tkinter.Frame, interior, ++ width=16, ++ height=16, ++ borderwidth=2, ++ relief='raised') ++ + # Create the value component. + self.value = self.createcomponent('value', +- (), None, +- tkinter.Label, interior, +- width = 3) +- ++ (), None, ++ tkinter.Label, interior, ++ width=3) ++ + # Create the scale component. +- if self['orient'] == 'vertical': +- # The default scale range seems to be +- # the wrong way around - reverse it. +- from_ = 100 +- to = 0 +- else: +- from_ = 0 +- to = 100 ++ if self['orient'] == 'vertical': ++ # The default scale range seems to be ++ # the wrong way around - reverse it. ++ from_ = 100 ++ to = 0 ++ else: ++ from_ = 0 ++ to = 100 + + self.scale = self.createcomponent('scale', +- (), None, +- tkinter.Scale, interior, +- orient = self['orient'], +- command = self._doCommand, +- tickinterval = 20, +- length = 200, +- from_ = from_, +- to = to, +- showvalue = 0) +- ++ (), None, ++ tkinter.Scale, interior, ++ orient=self['orient'], ++ command=self._doCommand, ++ tickinterval=20, ++ length=200, ++ from_=from_, ++ to=to, ++ showvalue=0) ++ + value = self['value'] + if value is not None: + self.scale.set(value) +- +- # Use grid to position all components +- if self['orient'] == 'vertical': +- self.indicator.grid(row = 1, column = 1) +- self.value.grid(row = 2, column = 1) +- self.scale.grid(row = 3, column = 1) +- # Create the label. +- self.createlabel(interior, childRows=3) +- else: +- self.indicator.grid(row = 1, column = 1) +- self.value.grid(row = 1, column = 2) +- self.scale.grid(row = 1, column = 3) +- # Create the label. +- self.createlabel(interior, childCols=3) ++ ++ # Use grid to position all components ++ if self['orient'] == 'vertical': ++ self.indicator.grid(row=1, column=1) ++ self.value.grid(row=2, column=1) ++ self.scale.grid(row=3, column=1) ++ # Create the label. ++ self.createlabel(interior, childRows=3) ++ else: ++ self.indicator.grid(row=1, column=1) ++ self.value.grid(row=1, column=2) ++ self.scale.grid(row=1, column=3) ++ # Create the label. ++ self.createlabel(interior, childCols=3) + + # Check keywords and initialise options. + self.initialiseoptions() + + def _doCommand(self, valueStr): +- valueInt = self.scale.get() +- colors = self['colors'] +- thresholds = self['threshold'] +- color = colors[-1] +- for index in range(len(colors) - 1): +- if valueInt <= thresholds[index]: +- color = colors[index] +- break +- self.indicator.configure(background = color) +- self.value.configure(text = valueStr) ++ valueInt = self.scale.get() ++ colors = self['colors'] ++ thresholds = self['threshold'] ++ color = colors[-1] ++ for index in range(len(colors) - 1): ++ if valueInt <= thresholds[index]: ++ color = colors[index] ++ break ++ self.indicator.configure(background=color) ++ self.value.configure(text=valueStr) ++ + + Pmw.forwardmethods(ThresholdScale, tkinter.Scale, 'scale') +- ++ + # Initialise tkinter and Pmw. + root = Pmw.initialise() + root.title('Pmw ThresholdScale demonstration') + + # Create and pack two ThresholdScale megawidgets. +-mega1 = ThresholdScale(scale_showvalue = 1) +-mega1.pack(side = 'left', padx = 10, pady = 10) ++mega1 = ThresholdScale(scale_showvalue=1) ++mega1.pack(side='left', padx=10, pady=10) + + mega2 = ThresholdScale( +- colors = ('green', 'yellow', 'red'), +- threshold = (50, 75), +- value = 80, +- indicator_width = 32, +- scale_width = 25) +-mega2.pack(side = 'left', padx = 10, pady = 10) ++ colors=('green', 'yellow', 'red'), ++ threshold=(50, 75), ++ value=80, ++ indicator_width=32, ++ scale_width=25) ++mega2.pack(side='left', padx=10, pady=10) + + # Create and pack two horizontal ThresholdScale megawidgets. + mega3 = ThresholdScale( +- orient = 'horizontal', +- labelpos = 'n', +- label_text = 'Horizontal') +-mega3.pack(side = 'top', padx = 10, pady = 10) +-mega4 = ThresholdScale(orient = 'horizontal') +-mega4.pack(side = 'top', padx = 10, pady = 10) ++ orient='horizontal', ++ labelpos='n', ++ label_text='Horizontal') ++mega3.pack(side='top', padx=10, pady=10) ++mega4 = ThresholdScale(orient='horizontal') ++mega4.pack(side='top', padx=10, pady=10) + + # Let's go. + root.mainloop() diff --git a/python-pmw.spec b/python-pmw.spec index e633308..01251ca 100644 --- a/python-pmw.spec +++ b/python-pmw.spec @@ -1,11 +1,10 @@ # Turn off the brp-python-bytecompile script %global srcname pmw -%global sum Python powerwidgets Name: python-pmw -Version: 2.0.0 -Release: 25%{?dist} -Summary: %{sum} +Version: 2.1.1 +Release: 1%{?dist} +Summary: Python powerwidgets License: MIT and GPLv2+ URL: http://pmw.sourceforge.net/ Source: http://downloads.sourceforge.net/pmw/Pmw-%{version}.tar.gz @@ -14,6 +13,9 @@ BuildRequires: python3-setuptools BuildRequires: dos2unix BuildArch: noarch +# Fix identation errors, patch created by using 'autopep8-1.6.0' +Patch0: %{name}-fix_identation_error.patch + %description Pmw is a toolkit for building high-level compound widgets in Python using the Tkinter module. It consists of a set of base classes and a @@ -22,7 +24,7 @@ foundation. These megawidgets include notebooks, comboboxes, selection widgets, paned widgets, scrolled widgets and dialog windows %package -n python3-%{srcname} -Summary: %{sum} +Summary: Python powerwidgets Requires: python3-tkinter %{?python_provide:%python_provide python3-%{srcname}} @@ -34,7 +36,7 @@ foundation. These megawidgets include notebooks, comboboxes, selection widgets, paned widgets, scrolled widgets and dialog windows. %prep -%autosetup -n Pmw-%{version} +%autosetup -n Pmw-%{version} -p1 %build %py3_build @@ -44,31 +46,19 @@ widgets, paned widgets, scrolled widgets and dialog windows. # file fixes chmod 644 Pmw/Pmw_1_3_3/doc/* -chmod 644 Pmw/Pmw_2_0_0/doc/* - -dir_list="Pmw_1_3_3/tests -Pmw_1_3_3/demos -Pmw_1_3_3/bin -Pmw_2_0_0/tests -Pmw_2_0_0/demos -Pmw_2_0_0/bin" - -for dir in $dir_list; do -for lib in ${RPM_BUILD_ROOT}%{python3_sitelib}/Pmw/$dir/*.py; do - sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new && - touch -r $lib $lib.new && - mv $lib.new $lib -done -done +chmod 644 Pmw/Pmw_2_1_1/doc/* rm -rf %{buildroot}%{python3_sitelib}/Pmw/Pmw_1_3_3 %files -n python3-%{srcname} -%doc Pmw/Pmw_2_0_0/doc +%doc Pmw/Pmw_2_1_1/doc %{python3_sitelib}/*egg-info -%{python3_sitelib}/Pmw +%{python3_sitelib}/Pmw/ %changelog +* Wed Jan 11 2023 Antonio Trande - 2.1.1-1 +- Release 2.1.1 + * Fri Jul 22 2022 Fedora Release Engineering - 2.0.0-25 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index efd8a70..3c2f5d3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c7c3f26c4f5abaa99807edefee578fc0 Pmw-2.0.0.tar.gz +SHA512 (Pmw-2.1.1.tar.gz) = 7f4c3181b0ae546f9f89cf666917fd9ea0161a2c4a4e6b5756e0aeb543fcd3ed4598c83e294b04312fea6a386b06b370668b4400f1497cc8b2fc2ab19a3fdd3d