File: wslsupport.py

package info (click to toggle)
bart 0.6.00-3%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,924 kB
  • sloc: ansic: 58,970; python: 639; cpp: 506; makefile: 423; sh: 350
file content (11 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
import string
import os

def PathCorrection(inData):
	outData=inData
	for i in string.ascii_lowercase: #Replace drive letters with /mnt/
		outData=outData.replace(i+':','/mnt/'+i) #if drive letter is supplied in lowercase
		outData=outData.replace(i.upper()+':','/mnt/'+i) #if drive letter is supplied as uppercase
	outData=outData.replace(os.path.sep, '/') #Change windows filesep to linux filesep

	return outData