diff --git a/twander.py b/twander.py index c2db775..17f959b 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.146 2004/03/11 09:46:08 tundra Exp $" +RCSID = "$Id: twander.py,v 3.147 2005/01/07 07:29:46 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -271,6 +271,7 @@ AUTOREFRESH = TRUE # Automatically refresh the directory display? CMDSHELL = "" # No CMDSHELL processing DEBUGLEVEL = 0 # No debug output +FORCEUNIXPATH = FALSE # Force Unix path separators regardless of OS MAXMENU = 32 # Maximum length of displayed menu MAXMENUBUF = 250 # Maximum size of internal menu buffer MAXNESTING = 32 # Maximum depth of nested variable definitions @@ -3931,29 +3932,39 @@ if UI.CurrentDir == SHOWDRIVES: currentdir = "" else: - currentdir = UI.CurrentDir + currentdir = StripPSEP(UI.CurrentDir) - cmd = cmd.replace(DIR, QUOTECHAR + StripPSEP(currentdir) + QUOTECHAR) selection = StripPSEP(UI.LastInSelection()) dselection = "" if selection: - dselection = QUOTECHAR + currentdir + selection + QUOTECHAR + dselection = QUOTECHAR + currentdir + PSEP + selection + QUOTECHAR selection = QUOTECHAR + selection + QUOTECHAR - cmd = cmd.replace(SELECTION, selection) - cmd = cmd.replace(DSELECTION, dselection) - selections = "" dselections = "" for selected in UI.AllSelection(): # Fill the various built-ins selected = StripPSEP(selected) - dselections += QUOTECHAR + currentdir + selected + QUOTECHAR + " " + dselections += QUOTECHAR + currentdir + PSEP + selected + QUOTECHAR + " " selections += QUOTECHAR + selected + QUOTECHAR + " " - + + + # Force Unix-style path separators if requested + + if FORCEUNIXPATH: + currentdir = currentdir.replace("\\", "/") + dselection = dselection.replace("\\", "/") + dselections = dselections.replace("\\", "/") + + + # Now do the actual replacements + + cmd = cmd.replace(DIR, QUOTECHAR + currentdir + QUOTECHAR) + cmd = cmd.replace(SELECTION, selection) + cmd = cmd.replace(DSELECTION, dselection) cmd = cmd.replace(SELECTIONS, selections) cmd = cmd.replace(DSELECTIONS, dselections) cmd = cmd.replace(HASH, COMMENT) @@ -3970,6 +3981,8 @@ if cmd.count(vblref): s = "" for m in UI.ProgMem[x]: + if FORCEUNIXPATH: + m = m.replace("\\", "/") s += QUOTECHAR + m + QUOTECHAR + " " cmd = cmd.replace(vblref, s) @@ -4451,8 +4464,12 @@ # Options (and their default values) which can be set in the configuration file -UI.OptionsBoolean = {"AUTOREFRESH":AUTOREFRESH, "NODETAILS":NODETAILS, "NONAVIGATE":NONAVIGATE, - "SORTREVERSE":SORTREVERSE, "SORTSEPARATE":SORTSEPARATE, "USETHREADS":USETHREADS, +UI.OptionsBoolean = {"AUTOREFRESH":AUTOREFRESH, + "FORCEUNIXPATH":FORCEUNIXPATH, + "NODETAILS":NODETAILS, "NONAVIGATE":NONAVIGATE, + "SORTREVERSE":SORTREVERSE, + "SORTSEPARATE":SORTSEPARATE, + "USETHREADS":USETHREADS, "USEWIN32ALL":USEWIN32ALL, "WARN":WARN} UI.OptionsNumeric = {"AFTERWAIT":AFTERWAIT,"DEBUGLEVEL":DEBUGLEVEL, "FSZ":FSZ, "MFSZ":MFSZ, "HFSZ":HFSZ,