diff --git a/twander.py b/twander.py index a98461e..051b620 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.80 2003/01/25 00:22:45 tundra Exp $" +RCSID = "$Id: twander.py,v 2.81 2003/01/28 01:22:14 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -210,7 +210,6 @@ USEWIN32ALL = TRUE # Use win32all features if available WARN = TRUE # Warnings on WIN32ALLON = TRUE # Flag for toggling win32all features while running -WIN32ENCODING = 'mbcs' # Default Win32 character encoding scheme ##### @@ -1939,11 +1938,6 @@ def ExecuteCommand(cmd, name, UseStartDir=FALSE, ResolveVars=FALSE, ResolveBuiltIns=TRUE, SaveUnresolved=FALSE): global UI - - # On Win32 make sure the command is a byte string, not unicode - if OSNAME == 'nt': - cmd = cmd.encode(WIN32ENCODING) - # Work with a copy of the passed command newcmd = cmd @@ -2190,25 +2184,9 @@ dList.insert(0, ".." + PSEP) # Save the complete list for details extraction below - # We save this now, before the unicode promotion which follows. - # A file name containting non-ASCII characters which is then - # promoted to unicode will cause the subsequent owner/group - # lookups under win32all to fail. So, we save the non-unicode - # versions here, and promote them later in the details handling. all = dList + fList - # Now, we promote the file/directory names to unicode so - # they will be properly handled throughout the rest of - # the code when we are: a) Running Win32, b) Showing no - # details, and c) Have file/directory names with non-ASCII - # characters. - - if OSNAME == 'nt': - for l in (dList, fList): - for x in range(len(l)): - l[x] = unicode(l[x], WIN32ENCODING) - # The user requested Drive List View. This is always displayed # without details, so we can return directly from here. @@ -2394,10 +2372,7 @@ detlist[index] += ftime + (ST_SZMTIME - len(ftime)) * " " # Add the File Name - if OSNAME == 'nt': - detlist[index] += unicode(all[index], WIN32ENCODING) - else: - detlist[index] += all[index] + detlist[index] += all[index] # Include symlink details as necessary if detlist[index][0] == 'l': @@ -2455,19 +2430,10 @@ # give the command author the maximum flexibility possible selection = StripPSEP(UI.LastInSelection()) - - # On Win32, make sure the string is not unicode - if OSNAME == 'nt': - selection = selection.encode(WIN32ENCODING) - selections = "" dselections = "" for selected in UI.AllSelection(): - # On Win32, make sure the string is not unicode - if OSNAME == 'nt': - selected = selected.encode(WIN32ENCODING) - # Fill the various built-ins selected = StripPSEP(selected) dselections += QUOTECHAR + UI.CurrentDir + selected + QUOTECHAR + " " @@ -2991,8 +2957,7 @@ UI.OptionsString = {"BCOLOR":BCOLOR, "FCOLOR":FCOLOR, "FNAME":FNAME, "FSZ":HFSZ, "FWT":FWT, # Main Font/Colors "MBCOLOR":MBCOLOR, "MFCOLOR":MFCOLOR, "MFNAME":MFNAME, "MFSZ":MFSZ, "MFWT":MFWT, # Menu Font/Colors "HBCOLOR":HBCOLOR, "HFCOLOR":HFCOLOR, "HFNAME":HFNAME, "HFSZ":HFSZ, "HFWT":HFWT, # Help Font/Colors - "MBARCOL":MBARCOL, "QUOTECHAR":QUOTECHAR, "STARTDIR":STARTDIR, # Other - "WIN32ENCODING":WIN32ENCODING} + "MBARCOL":MBARCOL, "QUOTECHAR":QUOTECHAR, "STARTDIR":STARTDIR} # Other # Prepare storage for key bindings UI.KeyBindings = {}