Welcome to mirror list, hosted at ThFree Co, Russian Federation.

readlink.py « tools - github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 446c8ebdca2dc570fe538e0498f2bd546dcda257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
"""Canonicalizes a path and follows any symlinks.

This is the equivalent of `readlink -f` on many Linux systems. This is
useful as there are often differences in readlink on different
platforms.

"""
from __future__ import print_function

import os
import sys


def main(link):
    return os.path.realpath(link)

if __name__ == '__main__':
    print(main(sys.argv[1]))