コード例 #1
0
def load_index(index_url, package_whitelist=None, package_blacklist=[]):
    '''
      Loads the index for a URL pointing to an index archive.

      :param index_url: the URL
      :type index_url: str
      :param package_whitelist: list of target package list
      :type package_whitelist: [str]
      :param package_blacklist: list of blacklisted package
      :type package_blacklist: [str]

      :returns: the index
      :rtype: rocon_app_utilities.RappIndexer
    '''
    logger.debug('load_index(%s)' % index_url)
    if not index_url.endswith('.index.tar.gz'):
        raise NotImplementedError(
            "The url of the index must end with '.index.tar.gz'")
    logger.debug('load_index() load gzipped tar index')
    tar_gz_str = load_url(index_url, skip_decode=True)
    tar_gz_stream = StringIO(tar_gz_str)
    index = read_tarball(fileobj=tar_gz_stream,
                         package_whitelist=package_whitelist,
                         package_blacklist=package_blacklist)
    index.source = index_url
    return index
コード例 #2
0
def _get_stack_info(distro, stack_name):
    global _stack_info
    if stack_name not in _stack_info:
        stack = distro.stacks[stack_name]
        version = stack.version
        url = 'http://ros-dry-releases.googlecode.com/svn/download/stacks/%(stack_name)s/%(stack_name)s-%(version)s/%(stack_name)s-%(version)s.yaml' % locals()
        logger.debug('Load dry package info from "%s"' % url)
        try:
            data = load_url(url)
        except URLError as e:
            raise RuntimeError("Could not fetch information for stack '%s' with version '%s': %s" % (stack_name, version, e))
        _stack_info[stack_name] = yaml.load(data)
    return _stack_info[stack_name]
コード例 #3
0
def _get_stack_info(distro, stack_name):
    global _stack_info
    if stack_name not in _stack_info:
        stack = distro.stacks[stack_name]
        version = stack.version
        url = 'http://ros-dry-releases.googlecode.com/svn/download/stacks/%(stack_name)s/%(stack_name)s-%(version)s/%(stack_name)s-%(version)s.yaml' % locals(
        )
        logger.debug('Load dry package info from "%s"' % url)
        try:
            data = load_url(url)
        except URLError as e:
            raise RuntimeError(
                "Could not fetch information for stack '%s' with version '%s': %s"
                % (stack_name, version, e))
        _stack_info[stack_name] = yaml.load(data)
    return _stack_info[stack_name]
コード例 #4
0
def load_index(index_url, package_whitelist=None, package_blacklist=[]):
    '''
      Loads the index for a URL pointing to an index archive.

      :param index_url: the URL
      :type index_url: str
      :param package_whitelist: list of target package list
      :type package_whitelist: [str]
      :param package_blacklist: list of blacklisted package
      :type package_blacklist: [str]

      :returns: the index
      :rtype: rocon_app_utilities.RappIndexer
    '''
    logger.debug('load_index(%s)' % index_url)
    if not index_url.endswith('.index.tar.gz'):
        raise NotImplementedError("The url of the index must end with '.index.tar.gz'")
    logger.debug('load_index() load gzipped tar index')
    tar_gz_str = load_url(index_url, skip_decode=True)
    tar_gz_stream = StringIO(tar_gz_str)
    index = read_tarball(fileobj=tar_gz_stream, package_whitelist=package_whitelist, package_blacklist=package_blacklist)
    index.source = index_url
    return index
コード例 #5
0
def test_distribution_file():
    url = 'file://' + FILES_DIR + '/foo/distribution.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    dist_file = DistributionFile('foo', data)
    _validate_dist_file(dist_file)
コード例 #6
0
def test_release_file():
    url = 'file://' + FILES_DIR + '/foo/distribution.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    rel_file = ReleaseFile('foo', data)
    _validate_rel_file(rel_file)
コード例 #7
0
def test_doc_file():
    url = 'file://' + FILES_DIR + '/foo/distribution.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    doc_file = DocFile('foo', data)
    _validate_doc_file(doc_file)
コード例 #8
0
def test_release_file():
    url = 'file://' + FILES_DIR + '/foo/distribution.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    rel_file = ReleaseFile('foo', data)
    _validate_rel_file(rel_file)
コード例 #9
0
def test_doc_build_file():
    url = 'file://' + FILES_DIR + '/foo/doc-build.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    DocBuildFile('foo', data)
コード例 #10
0
def test_distribution_file():
    url = 'file://' + FILES_DIR + '/foo/distribution.yaml'
    yaml_str = load_url(url)
    data = yaml.safe_load(yaml_str)
    dist_file = DistributionFile('foo', data)
    _validate_dist_file(dist_file)
コード例 #11
0
def test_release_build_file():
    url = 'file://' + FILES_DIR + '/foo/release-build.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    ReleaseBuildFile('foo', data)
コード例 #12
0
def test_release_build_file():
    url = 'file://' + FILES_DIR + '/foo/release-build.yaml'
    yaml_str = load_url(url)
    data = yaml.safe_load(yaml_str)
    ReleaseBuildFile('foo', data)
コード例 #13
0
ファイル: test_doc.py プロジェクト: AurelienBallier/rosdistro
def test_doc_file():
    url = 'file://' + FILES_DIR + '/foo/doc.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    doc_file = DocFile('foo', data)
    _validate_doc_file(doc_file)
コード例 #14
0
def test_source_file():
    url = 'file://' + FILES_DIR + '/foo/distribution.yaml'
    yaml_str = load_url(url)
    data = yaml.safe_load(yaml_str)
    src_file = SourceFile('foo', data)
    _validate_src_file(src_file)
コード例 #15
0
def test_source_build_file():
    url = 'file://' + FILES_DIR + '/foo/source-build.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    SourceBuildFile('foo', data)
コード例 #16
0
def test_doc_build_file():
    url = 'file://' + FILES_DIR + '/foo/doc-build.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    DocBuildFile('foo', data)
コード例 #17
0
ファイル: test_source.py プロジェクト: mikepurvis/rosdistro-1
def test_source_file():
    url = 'file://' + FILES_DIR + '/foo/distribution.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    src_file = SourceFile('foo', data)
    _validate_src_file(src_file)
コード例 #18
0
def test_source_build_file():
    url = 'file://' + FILES_DIR + '/foo/source-build.yaml'
    yaml_str = load_url(url)
    data = yaml.load(yaml_str)
    SourceBuildFile('foo', data)