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

View File

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

View File

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

View File

@@ -1,6 +1,4 @@
# Runtime dependencies needed when using wxPython Phoenix # Runtime dependencies needed when using wxPython Phoenix
numpy < 1.17 ; python_version <= '2.7'
numpy ; python_version >= '3.0' and python_version < '3.12' numpy ; python_version >= '3.0' and python_version < '3.12'
# pillow < 3.0 # 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 wx
import sys import sys
import six
from wx.lib.embeddedimage import PyEmbeddedImage from wx.lib.embeddedimage import PyEmbeddedImage
zoombackgrey = PyEmbeddedImage( zoombackgrey = PyEmbeddedImage(
@@ -375,7 +373,7 @@ class ZoomBarImage(object):
self._oldHeight = 0 self._oldHeight = 0
self._vCenter = 0 self._vCenter = 0
self._hCenter = 0 self._hCenter = 0
self._oldInc = -six.MAXSIZE self._oldInc = -sys.MAXSIZE
self._isSeparator = False self._isSeparator = False
self._enabled = True self._enabled = True

View File

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

View File

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

View File

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