use os independent path
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d3e830c59a
commit
6dc735c180
@ -22,13 +22,13 @@ class Executor:
|
|||||||
|
|
||||||
def createDirectory(self, dirName: str) -> str:
|
def createDirectory(self, dirName: str) -> str:
|
||||||
dirName = self.sanitizeDirectory(dirName)
|
dirName = self.sanitizeDirectory(dirName)
|
||||||
actualDirName = self.currentDirectory + "/" + dirName
|
actualDirName = os.path.join(self.currentDirectory, dirName)
|
||||||
os.mkdir(actualDirName)
|
os.mkdir(actualDirName)
|
||||||
return actualDirName
|
return actualDirName
|
||||||
|
|
||||||
def removeDirectory(self, dirName: str) -> str:
|
def removeDirectory(self, dirName: str) -> str:
|
||||||
dirName = self.sanitizeDirectory(dirName)
|
dirName = self.sanitizeDirectory(dirName)
|
||||||
actualDirName = self.currentDirectory + "/" + dirName
|
actualDirName = os.path.join(self.currentDirectory, dirName)
|
||||||
os.rmdir(actualDirName)
|
os.rmdir(actualDirName)
|
||||||
return actualDirName
|
return actualDirName
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class Executor:
|
|||||||
return self.currentDirectory
|
return self.currentDirectory
|
||||||
else:
|
else:
|
||||||
dirName = self.sanitizeDirectory(dirName)
|
dirName = self.sanitizeDirectory(dirName)
|
||||||
self.currentDirectory = self.currentDirectory + "/" + dirName
|
self.currentDirectory = os.path.join(self.currentDirectory, dirName)
|
||||||
return self.currentDirectory
|
return self.currentDirectory
|
||||||
|
|
||||||
def listCurrentDirectoryContent(self) -> str:
|
def listCurrentDirectoryContent(self) -> str:
|
||||||
@ -62,7 +62,7 @@ class Executor:
|
|||||||
|
|
||||||
def putFileInCurrentDirectory(self, filename: str, content) -> str:
|
def putFileInCurrentDirectory(self, filename: str, content) -> str:
|
||||||
filename = self.sanitizeFile(filename)
|
filename = self.sanitizeFile(filename)
|
||||||
currenctfile = self.currentDirectory + "/" + filename
|
currenctfile = os.path.join(self.currentDirectory, filename)
|
||||||
f = open(currenctfile, "wb")
|
f = open(currenctfile, "wb")
|
||||||
f.write(content)
|
f.write(content)
|
||||||
f.close()
|
f.close()
|
||||||
@ -70,11 +70,11 @@ class Executor:
|
|||||||
|
|
||||||
def getFileInCurrentDirectory(self, file: str):
|
def getFileInCurrentDirectory(self, file: str):
|
||||||
file = self.sanitizeFile(file)
|
file = self.sanitizeFile(file)
|
||||||
currentfile = self.currentDirectory + "/" + file
|
currentfile = os.path.join(self.currentDirectory, file)
|
||||||
return open(currentfile, "r")
|
return open(currentfile, "r")
|
||||||
|
|
||||||
def removeFileInCurrentDirectory(self, file: str) -> str:
|
def removeFileInCurrentDirectory(self, file: str) -> str:
|
||||||
file = self.sanitizeFile(file)
|
file = self.sanitizeFile(file)
|
||||||
currentfile = self.currentDirectory + "/" + file
|
currentfile = os.path.join(self.currentDirectory, file)
|
||||||
os.remove(currentfile)
|
os.remove(currentfile)
|
||||||
return currentfile
|
return currentfile
|
||||||
|
Loading…
Reference in New Issue
Block a user