vhdl_util.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:VHDL-Mode 作者: Remillard 项目源码 文件源码
def get_vhdl_setting(cmd_obj, key):
    '''
    Borrowing an idea from OdatNurd from ST forum, creating a method
    that will return the value of a key and also check to see if
    it's been overridden in project files.  Defaults are handled by
    the supplied sublime-settings file.

    This will actually work on the regular Preferences as well I think
    though might do bad things if the key doesn't exist.
    '''
    # Load the defaults, or user overridden defaults.
    vhdl_settings = sublime.load_settings('vhdl_mode.sublime-settings')
    default = vhdl_settings.get(key, None)
    # Load the view's settings
    view_settings = cmd_obj.view.settings()
    return view_settings.get(key, default)

#----------------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号