forked from pool/python-pmw
* https://sourceforge.net/p/pmw/patches/7/ OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pmw?expand=0&rev=13
60 lines
2.0 KiB
Diff
60 lines
2.0 KiB
Diff
diff -ur Pmw/Pmw_2_0_1.orig/bin/bundlepmw.py Pmw/Pmw_2_0_1/bin/bundlepmw.py
|
|
--- Pmw/Pmw_2_0_1.orig/bin/bundlepmw.py 2012-08-04 00:56:51.000000000 +0000
|
|
+++ Pmw/Pmw_2_0_1/bin/bundlepmw.py 2017-05-07 19:57:25.954264305 +0000
|
|
@@ -11,7 +11,6 @@
|
|
|
|
import os
|
|
import re
|
|
-import string
|
|
import sys
|
|
|
|
# The order of these files is significant. Files which reference
|
|
@@ -66,7 +65,7 @@
|
|
dir = expandLinks(dir)
|
|
dir = os.path.basename(dir)
|
|
|
|
-version = string.replace(dir[4:], '_', '.')
|
|
+version = dir[4:].replace('_', '.')
|
|
|
|
# Code to import the Color module.
|
|
colorCode = """
|
|
@@ -147,7 +146,8 @@
|
|
|
|
# Specially handle PmwBase.py file:
|
|
text = mungeFile('Base')
|
|
-text = re.sub('import PmwLogicalFont', '', text)
|
|
+text = re.sub('from . import PmwBlt', 'PmwBlt = Blt', text)
|
|
+text = re.sub('from . import PmwLogicalFont', '', text)
|
|
text = re.sub('PmwLogicalFont._font_initialise', '_font_initialise', text)
|
|
outfile.write(text)
|
|
if not needBlt:
|
|
diff -ur Pmw/Pmw_2_0_1.orig/lib/PmwColor.py Pmw/Pmw_2_0_1/lib/PmwColor.py
|
|
--- Pmw/Pmw_2_0_1.orig/lib/PmwColor.py 2013-02-26 13:01:23.000000000 +0000
|
|
+++ Pmw/Pmw_2_0_1/lib/PmwColor.py 2017-05-07 19:59:51.116891121 +0000
|
|
@@ -10,7 +10,7 @@
|
|
_TWO_PI = _PI * 2
|
|
_THIRD_PI = _PI / 3
|
|
_SIXTH_PI = _PI / 6
|
|
-_MAX_RGB = float(256 * 256 - 1) # max size of rgb values returned from Tk
|
|
+_MAX_RGB = 256 * 256 - 1 # max size of rgb values returned from Tk
|
|
|
|
def setscheme(root, background=None, **kw):
|
|
root = root._root()
|
|
@@ -346,13 +346,13 @@
|
|
lightRGB = []
|
|
darkRGB = []
|
|
for value in name2rgb(root, colorName, 1):
|
|
- value40pc = (14 * value) / 10
|
|
+ value40pc = (14 * value) // 10
|
|
if value40pc > _MAX_RGB:
|
|
value40pc = _MAX_RGB
|
|
- valueHalfWhite = (_MAX_RGB + value) / 2;
|
|
+ valueHalfWhite = (_MAX_RGB + value) // 2;
|
|
lightRGB.append(max(value40pc, valueHalfWhite))
|
|
|
|
- darkValue = (60 * value) / 100
|
|
+ darkValue = (60 * value) // 100
|
|
darkRGB.append(darkValue)
|
|
|
|
return (
|