2016-01-15 14:55:33 +01:00
|
|
|
# Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2013-05-15 13:17:33 +02:00
|
|
|
|
2012-10-23 15:15:45 +02:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2020-09-15 15:28:21 +02:00
|
|
|
|
2012-10-23 15:15:45 +02:00
|
|
|
def checkDirectory(directory):
|
|
|
|
if not os.path.exists(directory):
|
2020-09-15 15:28:21 +02:00
|
|
|
print("Given path '%s' does not exist" % directory)
|
2012-10-23 15:15:45 +02:00
|
|
|
sys.exit(1)
|
|
|
|
objMap = os.path.join(directory, "objects.map")
|
|
|
|
if not os.path.exists(objMap):
|
2020-09-15 15:28:21 +02:00
|
|
|
print("Given path '%s' does not contain an objects.map file" % directory)
|
2012-10-23 15:15:45 +02:00
|
|
|
sys.exit(1)
|
|
|
|
return objMap
|
|
|
|
|
2020-09-15 15:28:21 +02:00
|
|
|
|
2012-10-23 15:15:45 +02:00
|
|
|
def getFileContent(filePath):
|
|
|
|
if os.path.isfile(filePath):
|
|
|
|
f = open(filePath, "r")
|
|
|
|
data = f.read()
|
|
|
|
f.close()
|
|
|
|
return data
|
|
|
|
return ""
|