Return /etc/os-release in a dict.
346060
def lsb_release():
    """"""
    d = {}
    with open('/etc/os-release', 'r') as lsb:
        for l in lsb:
            s = l.split('=')
            if len(s) != 2:
                continue
            d[s[0].strip()] = s[1].strip()
    return d
106894
def _os_release_info(self):
        
        if os.path.isfile(self.os_release_file):
            with open(self.os_release_file) as release_file:
                return self._parse_os_release_content(release_file)
        return {}
1002981
def outfile(self):
        """"""
        return os.path.join(OPTIONS['base_dir'],
                            '{0}.{1}'.format(self.name, OPTIONS['out_ext']))
74711
def read_release_version():
    """"""
    import re
    dirname = os.path.abspath(os.path.dirname(__file__))

    try:
        f = open(os.path.join(dirname, "_version.py"), "rt")
        for line in f.readlines():

            m = re.match("__version__ = '([^']+)'", line)
            if m:
                ver = m.group(1)
                return ver

    except:
        return None

    return None
693000
def _release_lock(self):
        """"""
        if not self._has_lock():
            return

        # if someone removed our file beforhand, lets just flag this issue
        # instead of failing, to make it more usable.
        lfp = self._lock_file_path()
        try:
            rmfile(lfp)
        except OSError:
            pass
        self._owns_lock = False
476205
def package_releases(self, package_name):
        """"""
        if self.debug:
            self.logger.debug("DEBUG: querying PyPI for versions of " \
                    + package_name)
        return self.xmlrpc.package_releases(package_name)
361364
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'documents' in _dict:
            args['documents'] = EnvironmentDocuments._from_dict(
                _dict.get('documents'))
        if 'disk_usage' in _dict:
            args['disk_usage'] = DiskUsage._from_dict(_dict.get('disk_usage'))
        if 'collections' in _dict:
            args['collections'] = CollectionUsage._from_dict(
                _dict.get('collections'))
        return cls(**args)
1242383
def releasers(cls):
        

        return [
            HookReleaser,
            VersionFileReleaser,
            PythonReleaser,
            CocoaPodsReleaser,
            NPMReleaser,
            CReleaser,
            ChangelogReleaser,
            GitHubReleaser,
            GitReleaser,
        ]
492570
def check_options(options, parser):
    
    if not options.get('release_environment', None):
        print("release environment is required")
        parser.print_help()
        return os.EX_USAGE

    return 0
46856
def sync_out(self, release):
        """"""
        if release.get('rsync_out_objs'):
            tree = release['canonical_dir']
            if not os.path.isdir(tree):
                self.log.info('Creating %s', tree)
                os.makedirs(tree)
            self.call(release['rsync_out_objs'])
            self.call(release['rsync_out_rest'])
137155
def system(*args, **kwargs):
    """"""
    kwargs.setdefault('stdout', subprocess.PIPE)
    proc = subprocess.Popen(args, **kwargs)
    out, _ = proc.communicate()
    if proc.returncode:
        raise SystemExit(proc.returncode)
    return out.decode('utf-8')
85051
def get(cls):
    """"""
    return {
      SourceRootConfig,
      Reporting,
      Reproducer,
      RunTracker,
      Changed,
      BinaryUtil.Factory,
      Subprocess.Factory
    }
1214091
def _release_info():
    """"""
    pypi_url = 'http://pypi.python.org/pypi/fastfood/json'
    headers = {
        'Accept': 'application/json',
    }
    request = urllib.Request(pypi_url, headers=headers)
    response = urllib.urlopen(request).read().decode('utf_8')
    data = json.loads(response)
    return data
1020286
def os_info():
    
    return {
        'uname': dict(platform.uname()._asdict()),
        'path': os.environ.get('PATH', '').split(':'),
        'shell': os.environ.get('SHELL', '/bin/sh'),
    }
447616
function getWindowsVersion () {
    return spawn('ver').then(function (output) {
        var match = /\[Version (.*)\]\s*$/.exec(output);
        return Version.fromString(match[1]);
    }).fail(function () {
        return Version.fromString(os.release());
    });
}
1173758
def release(ctx, sdist=True, wheel=True, sign=True, dry_run=False, index=None):
    
    # Build docs first. Use terribad workaround pending invoke #146
    ctx.run("inv docs", pty=True, hide=False)
    # Move the built docs into where Epydocs used to live
    target = "docs"
    rmtree(target, ignore_errors=True)
    # TODO: make it easier to yank out this config val from the docs coll
    copytree("sites/docs/_build", target)
    # Publish
    publish(
        ctx, sdist=sdist, wheel=wheel, sign=sign, dry_run=dry_run, index=index
    )
    # Remind
    print(
        "\n\nDon't forget to update RTD's versions page for new minor "
        "releases!"
    )
1369770
def _release(level):
    """"""
    version, comment = _new_version(level)

    if version is not None:

        run(['git',
             'commit',
             str(VER_PATH.relative_to(BASE_PATH)),
             str(CHANGES_PATH.relative_to(BASE_PATH)),
             '--amend',
             '--no-edit',
             ])
        run(['git',
             'tag',
             '-a',
             'v' + version,
             '-m',
             '"' + comment + '"',
             ])
        run(['git',
             'push',
             'origin',
             '--tags',
             ])
        run(['git',
             'push',
             'origin',
             'master',
             '-f',
             ])