import os from base.module import Module class Bugs(Module): """ Interface for doing useful things with Bugs. TODO: add support for arbitrary bug trackers! python-bugzilla integration! """ def view(self, data): """ View a given bug number, or show all bugs for a given component Example: bugs view #1234, bugs view nethack """ if data[0] == '#': os.system('firefox "https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=%s"' % data[1:]) else: os.system('firefox "https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=%s&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc="' % data) def search(self, text): """ Search bugzilla for a given keyword """ os.system('firefox "https://bugzilla.redhat.com/buglist.cgi?query_format=specific&order=bugs.bug_id&bug_status=__open__&product=&content=%s"' % text) __all__ = ['Bugs']