summaryrefslogtreecommitdiffstats
path: root/Tools/pynche
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-16 17:02:34 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-16 17:02:34 (GMT)
commitbf82e374ee737992235cbe944c9ddbd58236a892 (patch)
treef8c8dccaa76d58f9cb7d8cc0abb1355be75ee369 /Tools/pynche
parentacbca71ea775fc488bead0876d0cdbd48670dcbc (diff)
downloadcpython-bf82e374ee737992235cbe944c9ddbd58236a892.zip
cpython-bf82e374ee737992235cbe944c9ddbd58236a892.tar.gz
cpython-bf82e374ee737992235cbe944c9ddbd58236a892.tar.bz2
More 2to3 fixes in the Tools directory. Fixes #2893.
Diffstat (limited to 'Tools/pynche')
-rw-r--r--Tools/pynche/ColorDB.py8
-rw-r--r--Tools/pynche/StripViewer.py12
-rw-r--r--Tools/pynche/pyColorChooser.py2
3 files changed, 11 insertions, 11 deletions
diff --git a/Tools/pynche/ColorDB.py b/Tools/pynche/ColorDB.py
index 6d52b40..fcf1b87 100644
--- a/Tools/pynche/ColorDB.py
+++ b/Tools/pynche/ColorDB.py
@@ -66,7 +66,7 @@ class ColorDB:
# version the `name', or the CapitalizedVersion, etc.
key = (red, green, blue)
foundname, aliases = self.__byrgb.get(key, (name, []))
- if foundname <> name and foundname not in aliases:
+ if foundname != name and foundname not in aliases:
aliases.append(name)
self.__byrgb[key] = (foundname, aliases)
# add to byname lookup
@@ -122,7 +122,7 @@ class ColorDB:
self.__allnames = []
for name, aliases in self.__byrgb.values():
self.__allnames.append(name)
- self.__allnames.sort(key=unicode.lower)
+ self.__allnames.sort(key=str.lower)
return self.__allnames
def aliases_of(self, red, green, blue):
@@ -209,7 +209,7 @@ def rrggbb_to_triplet(color):
"""Converts a #rrggbb color to the tuple (red, green, blue)."""
rgbtuple = _namedict.get(color)
if rgbtuple is None:
- if color[0] <> '#':
+ if color[0] != '#':
raise BadColor(color)
red = color[1:3]
green = color[3:5]
@@ -232,7 +232,7 @@ def triplet_to_rrggbb(rgbtuple):
_maxtuple = (256.0,) * 3
def triplet_to_fractional_rgb(rgbtuple):
- return map(operator.__div__, rgbtuple, _maxtuple)
+ return list(map(operator.__div__, rgbtuple, _maxtuple))
def triplet_to_brightness(rgbtuple):
diff --git a/Tools/pynche/StripViewer.py b/Tools/pynche/StripViewer.py
index 01bcbf6..a7de398 100644
--- a/Tools/pynche/StripViewer.py
+++ b/Tools/pynche/StripViewer.py
@@ -62,32 +62,32 @@ def constant(numchips):
# red variations, green+blue = cyan constant
def constant_red_generator(numchips, red, green, blue):
seq = constant(numchips)
- return map(None, [red] * numchips, seq, seq)
+ return list(map(None, [red] * numchips, seq, seq))
# green variations, red+blue = magenta constant
def constant_green_generator(numchips, red, green, blue):
seq = constant(numchips)
- return map(None, seq, [green] * numchips, seq)
+ return list(map(None, seq, [green] * numchips, seq))
# blue variations, red+green = yellow constant
def constant_blue_generator(numchips, red, green, blue):
seq = constant(numchips)
- return map(None, seq, seq, [blue] * numchips)
+ return list(map(None, seq, seq, [blue] * numchips))
# red variations, green+blue = cyan constant
def constant_cyan_generator(numchips, red, green, blue):
seq = constant(numchips)
- return map(None, seq, [green] * numchips, [blue] * numchips)
+ return list(map(None, seq, [green] * numchips, [blue] * numchips))
# green variations, red+blue = magenta constant
def constant_magenta_generator(numchips, red, green, blue):
seq = constant(numchips)
- return map(None, [red] * numchips, seq, [blue] * numchips)
+ return list(map(None, [red] * numchips, seq, [blue] * numchips))
# blue variations, red+green = yellow constant
def constant_yellow_generator(numchips, red, green, blue):
seq = constant(numchips)
- return map(None, [red] * numchips, [green] * numchips, seq)
+ return list(map(None, [red] * numchips, [green] * numchips, seq))
diff --git a/Tools/pynche/pyColorChooser.py b/Tools/pynche/pyColorChooser.py
index d2ad61a..9507847 100644
--- a/Tools/pynche/pyColorChooser.py
+++ b/Tools/pynche/pyColorChooser.py
@@ -28,7 +28,7 @@ class Chooser:
dbfile = options.get('databasefile', self.__databasefile)
# load the database file
colordb = None
- if dbfile <> self.__databasefile:
+ if dbfile != self.__databasefile:
colordb = ColorDB.get_colordb(dbfile)
if not self.__master:
from Tkinter import Tk