Did I find the right examples for you? yes no

All Samples(178)  |  Call(170)  |  Derive(0)  |  Import(8)
Tries to determine the name of the Linux OS distribution name.

The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
suitable files are found.

supported_dists may be given to define the set of Linux
distributions to look for. It defaults to a list of currently
supported Linux distributions identified by their release file
name.(more...)

        def linux_distribution(distname='', version='', id='',

                       supported_dists=_supported_dists,
                       full_distribution_name=1):

    """ Tries to determine the name of the Linux OS distribution name.

        The function first looks for a distribution release file in
        /etc and then reverts to _dist_try_harder() in case no
        suitable files are found.

        supported_dists may be given to define the set of Linux
        distributions to look for. It defaults to a list of currently
        supported Linux distributions identified by their release file
        name.

        If full_distribution_name is true (default), the full
        distribution read from the OS is returned. Otherwise the short
        name taken from supported_dists is used.

        Returns a tuple (distname,version,id) which default to the
        args given as parameters.

    """
    try:
        etc = os.listdir('/etc')
    except os.error:
        # Probably not a Unix system
        return distname,version,id
    etc.sort()
    for file in etc:
        m = _release_filename.match(file)
        if m is not None:
            _distname,dummy = m.groups()
            if _distname in supported_dists:
                distname = _distname
                break
    else:
        return _dist_try_harder(distname,version,id)

    # Read the first line
    f = open('/etc/'+file, 'r')
    firstline = f.readline()
    f.close()
    _distname, _version, _id = _parse_release_file(firstline)

    if _distname and full_distribution_name:
        distname = _distname
    if _version:
        version = _version
    if _id:
        id = _id
    return distname, version, id
        


src/i/n/Intersect-2.5-HEAD/Scripts/Samples/Shells.py   Intersect-2.5(Download)
 
    distro = os.uname()[1]
    distro2 = platform.linux_distribution()[0]
 
    Home_Dir = os.environ['HOME']

src/i/n/Intersect-2.5-HEAD/Scripts/Samples/Persist.py   Intersect-2.5(Download)
 
    distro = os.uname()[1]
    distro2 = platform.linux_distribution()[0]
 
    Home_Dir = os.environ['HOME']

src/i/n/Intersect-2.5-HEAD/Scripts/Samples/Network.py   Intersect-2.5(Download)
 
    distro = os.uname()[1]
    distro2 = platform.linux_distribution()[0]
 
    Home_Dir = os.environ['HOME']

src/i/n/Intersect-2.5-HEAD/Scripts/Samples/Gather.py   Intersect-2.5(Download)
 
    distro = os.uname()[1]
    distro2 = platform.linux_distribution()[0]
 
    Home_Dir = os.environ['HOME']

src/s/l/slapos.core-1.0.5/slapos/grid/distribution.py   slapos.core(Download)
            pass
 
    return platform.linux_distribution(distname, version, id, supported_dists, full_distribution_name)
 
 

src/s/l/slapos.core-HEAD/slapos/grid/distribution.py   slapos.core(Download)
            pass
 
    return platform.linux_distribution(distname, version, id, supported_dists, full_distribution_name)
 
 

src/c/l/cloudrunner-0.5/cloudrunner/node/matcher.py   cloudrunner(Download)
        try:
            # only OS, not version
            self.dist = platform.linux_distribution()[0]
            if not self.dist:
                # Try a hack for ArchLinux
                self.dist = platform.linux_distribution(
                    supported_dists=('arch'))[0]  # only OS, not version

src/b/i/BinaryBuilder-HEAD/BinaryBuilder.py   BinaryBuilder(Download)
 
    if system == 'Linux':
        dist = platform.linux_distribution(full_distribution_name=0)
        name = dist[0]
        ver  = dist[1]

src/s/l/slapos.package-0.1.1/slapos/package/distribution.py   slapos.package(Download)
            pass
 
    return platform.linux_distribution(distname, version, id, supported_dists, full_distribution_name)
 
class PackageManager:

src/r/o/rospkg-1.0.28/src/rospkg/os_detect.py   rospkg(Download)
    def __init__(self, lsb_name, get_version_fn=None):
        self.lsb_name = lsb_name
        if hasattr(platform,"linux_distribution"):
            self.lsb_info = platform.linux_distribution(full_distribution_name=0)
        elif hasattr(platform,"dist"):

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next