Utility.py 文件源码

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

项目:vspheretools 作者: devopshq 项目源码 文件源码
def SplitQName(qname):
    '''SplitQName(qname) -> (string, string)

       Split Qualified Name into a tuple of len 2, consisting 
       of the prefix and the local name.  

       (prefix, localName)

       Special Cases:
           xmlns -- (localName, 'xmlns')
           None -- (None, localName)
    '''

    l = qname.split(':')
    if len(l) == 1:
        l.insert(0, None)
    elif len(l) == 2:
        if l[0] == 'xmlns':
            l.reverse()
    else:
        return
    return tuple(l)

#
# python2.3 urllib.basejoin does not remove current directory ./
# from path and this causes problems on subsequent basejoins.
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号