Commit d007681b authored by Christian Stenger's avatar Christian Stenger

Squish: Improve changePermission()

Change-Id: I3ce1691afc2fad3949d216dee37b06a33e40f6f1
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent 86d7e28d
......@@ -50,9 +50,15 @@ def changeFilePermissions(dirPath, readPerm, writePerm, excludeFileNames=None):
return False
filePaths = [os.path.join(dirPath, fileName) for fileName in os.listdir(dirPath)
if fileName not in excludeFileNames]
result = True
for filePath in filter(os.path.isfile, filePaths):
os.chmod(filePath, permission)
return True
try:
os.chmod(filePath, permission)
except:
t,v = sys.exc_info()[:2]
test.log("Error: %s(%s)" % (str(t), str(v)))
result = False
return result
def isWritable(pathToFile):
if os.path.exists(pathToFile):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment