def editFile(initpath, srcfile): outputAnswer.headerPrint('EDIT FILE') status = filefun.editFile(initpath, srcfile, 'I am good guy\n') msgOutput("editFile", status) status = filefun.removeFile(initpath, srcfile) msgOutput("removeFile", status) return True
def editFileAndEditAgain(initpath, srcfile): outputAnswer.headerPrint('EDIT FILE AND EDIT AGAIN') status = filefun.editFile(initpath, srcfile, 'I am good guy\n') msgOutput("editFile", status) status = filefun.reEditFile(initpath, srcfile, 'actually not') msgOutput("reEditFile", status) status = filefun.removeFile(initpath, srcfile) itemOutput("removeFile", initpath, srcfile, status) return True
def renameFile(initpath, srcfile, dstfile): outputAnswer.headerPrint('REMOVE FILE') status = filefun.editFile(initpath, srcfile, 'I am good guy\n') msgOutput("editFile", status) status = filefun.renameFile(initpath, srcfile, dstfile) msgOutput("renameFile", status) status = filefun.removeFile(initpath, dstfile) itemOutput("removeFile", initpath, dstfile, status) return True
def copyFileToFolder(initpath, srcfile, srcfolder): outputAnswer.headerPrint('COPY FILE TO FOLDER') status = folderfun.createFolder(initpath, srcfolder) msgOutput("createFolder", status) status = filefun.editFile(initpath, srcfile, 'I am good guy\n') msgOutput("editFile", status) sleep(1) status = filefun.copyFileToFolder(initpath, srcfile, srcfolder) msgOutput("copyFileToFolder", status) status = filefun.removeFile(initpath, srcfile) msgOutput("removeFile", status) fileList = [srcfolder, srcfile] finalstatus = filefun.checkFileExist(initpath, fileList) status = folderfun.removeWholeFolder(initpath, srcfolder) msgOutput("removeWholeFolder", status) msgFinalOutput(finalstatus) return True