Some code refactoring

This commit is contained in:
Miroslav Stampar
2017-04-18 15:48:05 +02:00
parent 65b02d4ab0
commit 5f2bb88037
32 changed files with 233 additions and 261 deletions

View File

@@ -156,15 +156,15 @@ class Filesystem:
return retVal
def askCheckWrittenFile(self, localFile, remoteFile, forceCheck=False):
output = None
choice = None
if forceCheck is not True:
message = "do you want confirmation that the local file '%s' " % localFile
message += "has been successfully written on the back-end DBMS "
message += "file system ('%s')? [Y/n] " % remoteFile
output = readInput(message, default="Y")
choice = readInput(message, default='Y', boolean=True)
if forceCheck or (output and output.lower() == "y"):
if forceCheck or choice:
return self._checkFileLength(localFile, remoteFile)
return True
@@ -173,9 +173,8 @@ class Filesystem:
message = "do you want confirmation that the remote file '%s' " % remoteFile
message += "has been successfully downloaded from the back-end "
message += "DBMS file system? [Y/n] "
output = readInput(message, default="Y")
if not output or output in ("y", "Y"):
if readInput(message, default='Y', boolean=True):
return self._checkFileLength(localFile, remoteFile, True)
return None