msvs.py 文件源码

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

项目:StatisKit 作者: StatisKit 项目源码 文件源码
def _generateGUID(slnfile, name):
    """This generates a dummy GUID for the sln file to use.  It is
    based on the MD5 signatures of the sln filename plus the name of
    the project.  It basically just needs to be unique, and not
    change with each invocation."""
    m = hashlib.md5()
    # Normalize the slnfile path to a Windows path (\ separators) so
    # the generated file has a consistent GUID even if we generate
    # it on a non-Windows platform.
    m.update(bytearray(ntpath.normpath(str(slnfile)) + str(name),'utf-8'))
    solution = m.hexdigest().upper()
    # convert most of the signature to GUID form (discard the rest)
    solution = "{" + solution[:8] + "-" + solution[8:12] + "-" + solution[12:16] + "-" + solution[16:20] + "-" + solution[20:32] + "}"
    return solution
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号