def get_usertag(email): ret = query("get_usertag", email) serialize = dict() if isinstance(ret._aslist()[0][0], int): for pair in ret._asdict(): serialize[pair] = ret._asdict()[pair]._aslist() else: for pair in ret._aslist()[0]: serialize[pair['key']] = pair['value']._aslist() return emit(serialize, True)
def get_status(bugnumber): ret = query("get_status", bugnumber) serialize = dict() for key in ret._asdict()['item']._asdict()['value']._asdict(): value = ret._asdict()['item']._asdict()['value']._asdict()[key] if isinstance(value, basestring) or isinstance(value, int) or type(value) is list: serialize[key] = value else: serialize[key] = value._asdict() return emit(serialize, True)
def get_bug_log(bugnumber): ret = query("get_bug_log", bugnumber) serialize = [] for message in ret: messagedict = dict() for key in message._asdict(): if isinstance(message[key], basestring) or isinstance(message[key], int): messagedict[key]=message[key] else: messagedict[key]=message[key]._aslist() serialize.append(messagedict) return emit(serialize, True)
def get_bugs(conditions): conditions = conditions.split(',') return emit(query("get_bugs", conditions)._aslist(), True)
def bug_counts(source_name): return emit(query("bug_counts", source_name), True)
def versions(source_name): ret = query("versions", source_name) if isinstance(ret, basestring): ret = {"unstable": ret} # This is a dirty, dirty lie. return emit(ret, True)
def binary_names(source_name): ret = query("binary_names", source_name) if isinstance(ret, basestring): ret = ret.split() return emit(ret, True)
def maintainer_name(source_name): return emit(query("maintainer_name", source_name), True)
def priority(source_name): return emit(query("priority", source_name), True)
def section(source_name): return emit(query("section", source_name), True)
def standards_version(source_name): return emit(query("standards_version", source_name), True)
def uploaders(source_name): return emit(query("uploaders", source_name)._aslist(), True)
def maintainer_email(source_name): return emit(query("maintainer_email", source_name), True)
def newest_bugs(amount): return emit(query("newest_bugs", amount)._aslist(), True)
def lintian(source_name): return emit(query("lintian", source_name), True)
def get_versions(package, dist, arch): return emit(query("get_versions", {"package":package, "dist":dist, "arch":arch})._aslist(), True)
def latest_version(source_name): return emit(query("latest_version", source_name), True)