コード例 #1
0
def find_servers(servers):
    """ Get builds by ids. """
    build_list = list()
    for build in servers:
        results = spacegdn.builds(build=build)
        if len(results) > 0:
            build_list.append(results[0])
    return build_list
コード例 #2
0
ファイル: servers.py プロジェクト: CubeEngine/mc-man
def find_servers(servers):
    """ Get builds by ids. """
    build_list = list()
    for build in servers:
        results = spacegdn.builds(build=build)
        if len(results) > 0:
            build_list.append(results[0])
    return build_list
コード例 #3
0
def build_by_checksum(checksum):
    """ Find build by checksum.

    None is returned if the build was not found.

    """
    result = spacegdn.builds(where='build.checksum.eq.{}'.format(checksum))
    if len(result) < 1:
        return None
    return result[0]
コード例 #4
0
ファイル: servers.py プロジェクト: CubeEngine/mc-man
def build_by_checksum(checksum):
    """ Find build by checksum.

    None is returned if the build was not found.

    """
    result = spacegdn.builds(where='build.checksum.eq.{}'.format(checksum))
    if len(result) < 1:
        return None
    return result[0]
コード例 #5
0
def find_newest(server, channel):
    """ Find the newest version and build in a channel.

    Returns a tuple with the version name and build number.

    """
    channel_id = spacegdn.get_id(jar=server, channel=channel)
    result = spacegdn.builds(channel=channel_id)

    channel, version, build = find_latest_build(result)

    return version, build['build']
コード例 #6
0
ファイル: servers.py プロジェクト: CubeEngine/mc-man
def find_newest(server, channel):
    """ Find the newest version and build in a channel.

    Returns a tuple with the version name and build number.

    """
    channel_id = spacegdn.get_id(jar=server, channel=channel)
    result = spacegdn.builds(channel=channel_id)

    channel, version, build = find_latest_build(result)

    return version, build['build']
コード例 #7
0
ファイル: servers.py プロジェクト: CubeEngine/mc-man
def get_builds(server, channel, version, build):
    """ Get the build.

    Any argument might be None.

    A list of matching builds is returned on success, or the error dictionary
    as returned by SpaceGDN.

    """
    server = get_id_raise_valueerror('server', server)
    if channel is not None:
        channel = get_id_raise_valueerror('channel', server, channel)
    if version is not None:
        version = get_id_raise_valueerror('version', server, channel, version)
    if build is not None:
        build = get_id_raise_valueerror('build', server, channel, version,
                                        build)

    return spacegdn.builds(jar=server, channel=channel,
                           version=version, build=build)
コード例 #8
0
def get_builds(server, channel, version, build):
    """ Get the build.

    Any argument might be None.

    A list of matching builds is returned on success, or the error dictionary
    as returned by SpaceGDN.

    """
    server = get_id_raise_valueerror('server', server)
    if channel is not None:
        channel = get_id_raise_valueerror('channel', server, channel)
    if version is not None:
        version = get_id_raise_valueerror('version', server, channel, version)
    if build is not None:
        build = get_id_raise_valueerror('build', server, channel, version,
                                        build)

    return spacegdn.builds(jar=server,
                           channel=channel,
                           version=version,
                           build=build)