当前位置: 首页>>代码示例>>Python>>正文


Python GlobalData.application方法代码示例

本文整理汇总了Python中utils.globals.GlobalData.application方法的典型用法代码示例。如果您正苦于以下问题:Python GlobalData.application方法的具体用法?Python GlobalData.application怎么用?Python GlobalData.application使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utils.globals.GlobalData的用法示例。


在下文中一共展示了GlobalData.application方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: codimensionMain

# 需要导入模块: from utils.globals import GlobalData [as 别名]
# 或者: from utils.globals.GlobalData import application [as 别名]
def codimensionMain():
    """ The codimension driver """

    # Parse command line arguments
    parser = OptionParser(
    """
    %prog [options] [project file | python files]
    Runs codimension UI
    """,
    version = "%prog " + __version__ )

    parser.add_option( "--debug",
                       action="store_true", dest="debug", default=False,
                       help="switch on debug and info messages (default: Off)" )
    parser.add_option( "--clean-start",
                       action="store_true", dest="cleanStart", default=False,
                       help="do not restore previous IDE state (default: Off)" )

    options, args = parser.parse_args()

    # Configure logging
    setupLogging( options.debug )

    # The default exception handler can be replaced
    sys.excepthook = exceptionHook

    # Create global data singleton.
    # It's unlikely to throw any exceptions.
    globalData = GlobalData()
    globalData.version = __version__

    # Loading settings - they have to be loaded before the application is
    # created. This is because the skin name is saved there.
    settings = Settings()
    copySkin()

    # Load the skin
    globalData.skin = Skin()
    globalData.skin.load( settingsDir + "skins" +
                          os.path.sep + settings.skin )

    # QT on UBUNTU has a bug - the main menu bar does not generate the
    # 'aboutToHide' signal (though 'aboutToShow' is generated properly. This
    # prevents codimension working properly so this hack below disables the
    # global menu bar for codimension and makes it working properly.
    os.environ[ "QT_X11_NO_NATIVE_MENUBAR" ] = "1"

    # Create QT application
    codimensionApp = CodimensionApplication( sys.argv, settings.style )
    globalData.application = codimensionApp

    logging.debug( "Starting codimension v." + __version__ )

    try:
        # Process command line arguments
        projectFile = processCommandLineArgs( args )
    except Exception, exc:
        logging.error( str( exc ) )
        parser.print_help()
        return 1
开发者ID:eaglexmw,项目名称:codimension,代码行数:62,代码来源:codimension.py


注:本文中的utils.globals.GlobalData.application方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。