1691 ############################################################################### |
1691 ############################################################################### |
1692 # PyQt utility functions below |
1692 # PyQt utility functions below |
1693 ############################################################################### |
1693 ############################################################################### |
1694 |
1694 |
1695 |
1695 |
1696 def generatePyQtToolPath(toolname): |
1696 def generatePyQtToolPath(toolname, alternatives=None): |
1697 """ |
1697 """ |
1698 Module function to generate the executable path for a PyQt tool. |
1698 Module function to generate the executable path for a PyQt tool. |
1699 |
1699 |
1700 @param toolname base name of the tool |
1700 @param toolname base name of the tool |
1701 @type str |
1701 @type str |
|
1702 @param alternatives list of alternative tool names to try |
|
1703 @type list of str |
1702 @return executable path name of the tool |
1704 @return executable path name of the tool |
1703 @rtype str |
1705 @rtype str |
1704 """ |
1706 """ |
1705 pyqtVariant = int(toolname[-1]) |
1707 pyqtVariant = int(toolname[-1]) |
1706 pyqtToolsPath = getPyQtToolsPath(pyqtVariant) |
1708 pyqtToolsPath = getPyQtToolsPath(pyqtVariant) |
1711 else: |
1713 else: |
1712 if isWindowsPlatform(): |
1714 if isWindowsPlatform(): |
1713 exe = getWindowsExecutablePath(toolname) |
1715 exe = getWindowsExecutablePath(toolname) |
1714 else: |
1716 else: |
1715 exe = toolname |
1717 exe = toolname |
|
1718 |
|
1719 if not isinpath(exe) and alternatives: |
|
1720 ex_ = generatePyQtToolPath(alternatives[0], alternatives[1:]) |
|
1721 if isinpath(ex_): |
|
1722 exe = ex_ |
|
1723 |
1716 return exe |
1724 return exe |
1717 |
1725 |
1718 ############################################################################### |
1726 ############################################################################### |
1719 # PySide utility functions below |
1727 # PySide utility functions below |
1720 ############################################################################### |
1728 ############################################################################### |