finish removing six

This commit is contained in:
Alexandre Detiste
2024-03-22 08:15:00 +01:00
committed by Scott Talbert
parent 323e78c085
commit 66a9320917
8 changed files with 18 additions and 21 deletions

View File

@@ -2,7 +2,6 @@
import wx
import wx.lib.mixins.listctrl as listmix
from six import unichr
#----------------------------------------------------------------------
@@ -265,15 +264,15 @@ class KeyLog(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
if keycode == 0:
keyname = "NUL"
elif keycode < 27:
keyname = u"Ctrl-%s" % unichr(ord('A') + keycode-1)
keyname = u"Ctrl-%s" % chr(ord('A') + keycode-1)
else:
keyname = u"\"%s\"" % unichr(keycode)
keyname = u"\"%s\"" % chr(keycode)
else:
keyname = u"(%s)" % keycode
UniChr = ''
if "unicode" in wx.PlatformInfo:
UniChr = "\"" + unichr(evt.GetUnicodeKey()) + "\""
UniChr = "\"" + chr(evt.GetUnicodeKey()) + "\""
modifiers = ""
for mod, ch in [(evt.ControlDown(), 'C'),

View File

@@ -52,8 +52,11 @@
# Last updated: Andrea Gavana, 20 Oct 2008, 18.00 GMT
import sys, os, time, traceback
import pickle
import re
import shutil
import urllib.error
import urllib.request
from io import BytesIO
from threading import Thread
@@ -67,8 +70,6 @@ from wx.adv import TaskBarIcon as TaskBarIcon
from wx.adv import SplashScreen as SplashScreen
import wx.lib.mixins.inspection
from six.moves import cPickle
from six.moves import urllib
import version
@@ -1636,7 +1637,7 @@ class wxPythonDemo(wx.Frame):
with open(pickledFile, "rb") as fid:
try:
self.pickledData = cPickle.load(fid)
self.pickledData = pickle.load(fid)
except:
self.pickledData = {}
@@ -1677,7 +1678,7 @@ class wxPythonDemo(wx.Frame):
item.Check(self.allowDocs)
self.Bind(wx.EVT_MENU, self.OnAllowDownload, item)
item = wx.MenuItem(menu, -1, 'Delete saved docs', 'Deletes the cPickle file where docs are stored')
item = wx.MenuItem(menu, -1, 'Delete saved docs', 'Deletes the pickle file where docs are stored')
item.SetBitmap(images.catalog['deletedocs'].GetBitmap())
menu.Append(item)
self.Bind(wx.EVT_MENU, self.OnDeleteDocs, item)
@@ -2486,7 +2487,7 @@ class wxPythonDemo(wx.Frame):
MakeDocDirs()
pickledFile = GetDocFile()
with open(pickledFile, "wb") as fid:
cPickle.dump(self.pickledData, fid, cPickle.HIGHEST_PROTOCOL)
pickle.dump(self.pickledData, fid, pickle.HIGHEST_PROTOCOL)
self.Destroy()

View File

@@ -1,6 +1,6 @@
import random
import time
from six.moves import _thread
import _thread
import wx
import wx.lib.newevent

View File

@@ -1,6 +1,4 @@
# Runtime dependencies needed when using wxPython Phoenix
numpy < 1.17 ; python_version <= '2.7'
numpy ; python_version >= '3.0' and python_version < '3.12'
# pillow < 3.0
six
typing-extensions; python_version < '3.11'
typing-extensions; python_version < '3.11'

View File

@@ -133,8 +133,6 @@ Version 0.1
import wx
import sys
import six
from wx.lib.embeddedimage import PyEmbeddedImage
zoombackgrey = PyEmbeddedImage(
@@ -375,7 +373,7 @@ class ZoomBarImage(object):
self._oldHeight = 0
self._vCenter = 0
self._hCenter = 0
self._oldInc = -six.MAXSIZE
self._oldInc = -sys.MAXSIZE
self._isSeparator = False
self._enabled = True

View File

@@ -41,12 +41,11 @@ import string
import types
import wx
import six
#----------------------------------------------------------------------------
MAXSIZE = six.MAXSIZE # (constants should be in upper case)
MINSIZE = -six.MAXSIZE-1
MAXSIZE = sys.maxsize # (constants should be in upper case)
MINSIZE = -sys.MAXSIZE-1
LONGTYPE = int
#----------------------------------------------------------------------------

View File

@@ -80,9 +80,9 @@ will be adjusted accordingly.::
bmp = img.ConvertToScaledBitmap(wx.Size(24,24), self)
"""
from itertools import zip_longest
import wx
from six.moves import zip_longest
from ._nanosvg import *

View File

@@ -33,7 +33,9 @@ Usage: python pywxrc.py -h
import sys, os, getopt, glob, re
import xml.dom.minidom as minidom
from six import byte2int
import operator
byte2int = operator.itemgetter(0)
#----------------------------------------------------------------------