Skip to content

Commit ae7aa42

Browse files
authored
Remove code commented for more than 10 years (GH-16965)
test_urllib commented since 2007: commit d9880d0 Author: Facundo Batista <[email protected]> Date: Fri May 25 04:20:22 2007 +0000 Commenting out the tests until find out who can test them in one of the problematic enviroments. pynche code commented since 1998 and 2001: commit ef30092 Author: Barry Warsaw <[email protected]> Date: Tue Dec 15 01:04:38 1998 +0000 Added most of the mechanism to change the strips from color variations to color constants (i.e. red constant, green constant, blue constant). But I haven't hooked this up yet because the UI gets more crowded and the arrows don't reflect the correct values. Added "Go to Black" and "Go to White" buttons. commit 741eae0 Author: Barry Warsaw <[email protected]> Date: Wed Apr 18 03:51:55 2001 +0000 StripWidget.__init__(), update_yourself(): Removed some unused local variables reported by PyChecker. __togglegentype(): PyChecker accurately reported that the variable __gentypevar was unused -- actually this whole method is currently unused so comment it out.
1 parent 0ac6137 commit ae7aa42

File tree

2 files changed

+0
-115
lines changed

2 files changed

+0
-115
lines changed

Lib/test/test_urllib.py

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,85 +1544,6 @@ def open_local_file(self, url):
15441544
self.assertRaises(OSError, DummyURLopener().retrieve, url)
15451545

15461546

1547-
# Just commented them out.
1548-
# Can't really tell why keep failing in windows and sparc.
1549-
# Everywhere else they work ok, but on those machines, sometimes
1550-
# fail in one of the tests, sometimes in other. I have a linux, and
1551-
# the tests go ok.
1552-
# If anybody has one of the problematic environments, please help!
1553-
# . Facundo
1554-
#
1555-
# def server(evt):
1556-
# import socket, time
1557-
# serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1558-
# serv.settimeout(3)
1559-
# serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
1560-
# serv.bind(("", 9093))
1561-
# serv.listen()
1562-
# try:
1563-
# conn, addr = serv.accept()
1564-
# conn.send("1 Hola mundo\n")
1565-
# cantdata = 0
1566-
# while cantdata < 13:
1567-
# data = conn.recv(13-cantdata)
1568-
# cantdata += len(data)
1569-
# time.sleep(.3)
1570-
# conn.send("2 No more lines\n")
1571-
# conn.close()
1572-
# except socket.timeout:
1573-
# pass
1574-
# finally:
1575-
# serv.close()
1576-
# evt.set()
1577-
#
1578-
# class FTPWrapperTests(unittest.TestCase):
1579-
#
1580-
# def setUp(self):
1581-
# import ftplib, time, threading
1582-
# ftplib.FTP.port = 9093
1583-
# self.evt = threading.Event()
1584-
# threading.Thread(target=server, args=(self.evt,)).start()
1585-
# time.sleep(.1)
1586-
#
1587-
# def tearDown(self):
1588-
# self.evt.wait()
1589-
#
1590-
# def testBasic(self):
1591-
# # connects
1592-
# ftp = urllib.ftpwrapper("myuser", "mypass", "localhost", 9093, [])
1593-
# ftp.close()
1594-
#
1595-
# def testTimeoutNone(self):
1596-
# # global default timeout is ignored
1597-
# import socket
1598-
# self.assertIsNone(socket.getdefaulttimeout())
1599-
# socket.setdefaulttimeout(30)
1600-
# try:
1601-
# ftp = urllib.ftpwrapper("myuser", "mypass", "localhost", 9093, [])
1602-
# finally:
1603-
# socket.setdefaulttimeout(None)
1604-
# self.assertEqual(ftp.ftp.sock.gettimeout(), 30)
1605-
# ftp.close()
1606-
#
1607-
# def testTimeoutDefault(self):
1608-
# # global default timeout is used
1609-
# import socket
1610-
# self.assertIsNone(socket.getdefaulttimeout())
1611-
# socket.setdefaulttimeout(30)
1612-
# try:
1613-
# ftp = urllib.ftpwrapper("myuser", "mypass", "localhost", 9093, [])
1614-
# finally:
1615-
# socket.setdefaulttimeout(None)
1616-
# self.assertEqual(ftp.ftp.sock.gettimeout(), 30)
1617-
# ftp.close()
1618-
#
1619-
# def testTimeoutValue(self):
1620-
# ftp = urllib.ftpwrapper("myuser", "mypass", "localhost", 9093, [],
1621-
# timeout=30)
1622-
# self.assertEqual(ftp.ftp.sock.gettimeout(), 30)
1623-
# ftp.close()
1624-
1625-
16261547
class RequestTests(unittest.TestCase):
16271548
"""Unit tests for urllib.request.Request."""
16281549

Tools/pynche/StripViewer.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -371,22 +371,6 @@ def __init__(self, switchboard, master=None):
371371
command=self.__togglehex)
372372
hexbtn.grid(row=1, column=1, sticky=W)
373373

374-
# XXX: ignore this feature for now; it doesn't work quite right yet
375-
376-
## gentypevar = self.__gentypevar = IntVar()
377-
## self.__variations = Radiobutton(frame,
378-
## text='Variations',
379-
## variable=gentypevar,
380-
## value=0,
381-
## command=self.__togglegentype)
382-
## self.__variations.grid(row=0, column=1, sticky=W)
383-
## self.__constants = Radiobutton(frame,
384-
## text='Constants',
385-
## variable=gentypevar,
386-
## value=1,
387-
## command=self.__togglegentype)
388-
## self.__constants.grid(row=1, column=1, sticky=W)
389-
390374
# create the white button
391375
whitebtn = Button(frame2,
392376
text='White',
@@ -402,26 +386,6 @@ def __togglehex(self, event=None):
402386
red, green, blue = self.__sb.current_rgb()
403387
self.update_yourself(red, green, blue)
404388

405-
## def __togglegentype(self, event=None):
406-
## which = self.__gentypevar.get()
407-
## if which == 0:
408-
## self.__reds.set(label='Red Variations',
409-
## generator=constant_cyan_generator)
410-
## self.__greens.set(label='Green Variations',
411-
## generator=constant_magenta_generator)
412-
## self.__blues.set(label='Blue Variations',
413-
## generator=constant_yellow_generator)
414-
## elif which == 1:
415-
## self.__reds.set(label='Red Constant',
416-
## generator=constant_red_generator)
417-
## self.__greens.set(label='Green Constant',
418-
## generator=constant_green_generator)
419-
## self.__blues.set(label='Blue Constant',
420-
## generator=constant_blue_generator)
421-
## else:
422-
## assert 0
423-
## self.__sb.update_views_current()
424-
425389
def __toblack(self, event=None):
426390
self.__sb.update_views(0, 0, 0)
427391

0 commit comments

Comments
 (0)