コード例 #1
0
ファイル: platform.py プロジェクト: galaxysd/BitTorrent
def resolve_shortcut(path):
    if os.name == 'nt':
        sc = Shortcut()
        sc.load(path)
        return sc.GetPath(0)[0]
    else:
        # boy, I don't know
        return path
コード例 #2
0
ファイル: platform.py プロジェクト: hitzjd/DHT
def resolve_shortcut(path):
    if os.name == 'nt':
        sc = Shortcut()
        sc.load(path)
        return sc.GetPath(0)[0]
    else:
        # boy, I don't know
        return path
コード例 #3
0
ファイル: platform.py プロジェクト: hitzjd/DHT
def create_shortcut(source, dest, *args):
    if os.name == 'nt':
        if len(args) == 0:
            args = None
        path, file = os.path.split(source)
        sc = Shortcut(source, arguments=args, workingdir=path)
        sc.save(dest)
    else:
        # some other os may not support this, but throwing an error is good since
        # the function couldn't do what was requested
        os.symlink(source, dest)
        # linux also can't do args... maybe we should spit out a shell script?
        assert not args
コード例 #4
0
ファイル: platform.py プロジェクト: galaxysd/BitTorrent
def create_shortcut(source, dest, *args):
    if os.name == 'nt':
        if len(args) == 0:
            args = None
        path, file = os.path.split(source)        
        sc = Shortcut(source,
                      arguments=args,
                      workingdir=path)
        sc.save(dest)                  
    else:
        # some other os may not support this, but throwing an error is good since
        # the function couldn't do what was requested
        os.symlink(source, dest)
        # linux also can't do args... maybe we should spit out a shell script?
        assert not args