removeTranslationFiles.py 812 B

12345678910111213141516171819202122232425262728
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. import os
  9. filterAction = ".ts"
  10. walkPath = "qml"
  11. execCmd = "start /B "
  12. for root, dirs, files in os.walk(walkPath):
  13. if filterAction == ".ts":
  14. for name in files:
  15. # remove all the .ts files
  16. if name.endswith(".ts"):
  17. os.remove(os.path.join(root, name))
  18. if filterAction == ".qml":
  19. for name in files:
  20. if name.endswith(".qml"):
  21. filePath = os.path.join(root, name)
  22. print(filePath)
  23. # open the .qml file in the default editor (QtCreator)
  24. os.system(execCmd + filePath)