def wrapper(username, coprname, **kwargs): if username.startswith("@"): group_name = username[1:] copr = ComplexLogic.get_group_copr_safe(group_name, coprname) else: copr = ComplexLogic.get_copr_safe(username, coprname) return f(copr, **kwargs)
def wrapper(**kwargs): coprname = kwargs.pop("coprname") if "group_name" in kwargs: group_name = kwargs.pop("group_name") copr = ComplexLogic.get_group_copr_safe(group_name, coprname, with_mock_chroots=True) else: username = kwargs.pop("username") copr = ComplexLogic.get_copr_safe(username, coprname, with_mock_chroots=True) return f(copr, **kwargs)