當前位置: 首頁>>代碼示例>>Python>>正文


Python QDir.current方法代碼示例

本文整理匯總了Python中PyQt.QtCore.QDir.current方法的典型用法代碼示例。如果您正苦於以下問題:Python QDir.current方法的具體用法?Python QDir.current怎麽用?Python QDir.current使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt.QtCore.QDir的用法示例。


在下文中一共展示了QDir.current方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: eprint

# 需要導入模塊: from PyQt.QtCore import QDir [as 別名]
# 或者: from PyQt.QtCore.QDir import current [as 別名]
        eprint(out)
    if len(out) == 0:
        print("QGIS Test Runner - [WARNING] subprocess returned no output")
    print('='*60)

    print("QGIS Test Runner - %s bytes returned and finished with exit code: %s" % (len(out), 0 if ok else 1))
    sys.exit(0 if ok else 1)

else: # We are inside QGIS!
    # Start as soon as the initializationCompleted signal is fired
    from qgis.core import QgsApplication
    from PyQt.QtCore import QDir
    from qgis.utils import iface

    # Add current working dir to the python path
    sys.path.append(QDir.current().path())

    def __run_test():
        """
        Run the test specified as last argument in the command line.
        """
        eprint("QGIS Test Runner Inside - starting the tests ...")
        try:
            test_module_name = QgsApplication.instance().argv()[-1]
            function_name = __get_test_function(test_module_name)
            if function_name is None:
                eprint("QGIS Test Runner Inside - [ERROR] cannot load test function from %s" % test_module_name)
            function_name()
        except Exception, e:
            eprint("QGIS Test Runner Inside - [ERROR] Exception: %s" % e)
        app = QgsApplication.instance()
開發者ID:elpaso,項目名稱:qgis-desktop-docker,代碼行數:33,代碼來源:qgis_testrunner.py


注:本文中的PyQt.QtCore.QDir.current方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。