From ce1644b4e20416763e6e5e72c2a950b3d6618b19 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jan 31 2019 00:59:56 +0000 Subject: PR#1182: hub: document get_channel arguments Merges #1182 https://pagure.io/koji/pull-request/1182 --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 86d8648..86b6633 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -4713,7 +4713,18 @@ def edit_host(hostInfo, **kw): return True def get_channel(channelInfo, strict=False): - """Return information about a channel.""" + """ + Look up the ID number and name for a channel. + + :param channelInfo: channel ID or name + :type channelInfo: int or str + :param bool strict: If True, raise an error if we found no matching + channel. If False, simply return None if we found no + matching channel. If unspecified, the default value is + False. + :returns: dict of the channel ID and name, or None. + For example, {'id': 20, 'name': 'container'} + """ fields = ('id', 'name') query = """SELECT %s FROM channels WHERE """ % ', '.join(fields)