示例#1
0
    def keyword_k(self, params=None, **kwargs):
        """Retrieve kernel.org Bugzilla bug information (ex: K12345)"""
        if params:
            params = utils.ensure_int(params)
            if not params:
                return

            query = urllib.urlencode({"id": params})
            url = "http://bugzilla.kernel.org/show_bug.cgi?%s" % query
            response = self.irc.fetch_url(url, self.name)
            if not response or not isinstance(params, int):
                return

            soup = BeautifulSoup(response.read())
            desc = utils.decode_entities(soup.head.title.string)

            try:
                status = soup.find("span", {
                    "id": "static_bug_status"
                }).string.strip().capitalize()
                assignee = utils.decode_entities(
                    soup.findAll("span",
                                 {"class": "vcard"})[0].contents[0].string)

                self.irc.reply("Kernel.org %s [Status: %s, Assignee: %s] %s" %
                               (desc, status, assignee, url))
            except TypeError:
                return
示例#2
0
    def keyword_k(self, params=None, **kwargs):
        """Retrieve kernel.org Bugzilla bug information (ex: K12345)"""
        if params:
            params = utils.ensure_int(params)
            if not params:
                return

            query = urllib.urlencode({"id": params})
            url = "http://bugzilla.kernel.org/show_bug.cgi?%s" % query
            response = self.irc.fetch_url(url, self.name)
            if not response or not isinstance(params, int):
                return

            soup = BeautifulSoup(response.read())
            desc = utils.decode_entities(soup.head.title.string)

            try:
                status = soup.find("span", {"id":
                        "static_bug_status"}).string.strip().capitalize()
                assignee = utils.decode_entities(soup.findAll("span",
                        {"class": "vcard"})[0].contents[0].string)

                self.irc.reply("Kernel.org %s [Status: %s, Assignee: %s] %s" %
                        (desc, status, assignee, url))
            except TypeError:
                return
示例#3
0
    def keyword_lp(self, params=None, **kwargs):
        """Retrieve Launchpad bug information (ex: LP12345)"""
        if params:
            params = utils.ensure_int(params)
            if not params:
                return

            try:
                bug = self.launchpad.bugs[params]
                task = bug.bug_tasks[len(bug.bug_tasks) - 1]

                self.irc.reply("LP %s [Status: %s, Assignee: %s] %s" % (
                        task.title, task.status,
                        self._find_name(task.assignee_link), bug.web_link))
            except Exception:
                return
示例#4
0
    def keyword_lp(self, params=None, **kwargs):
        """Retrieve Launchpad bug information (ex: LP12345)"""
        if params:
            params = utils.ensure_int(params)
            if not params:
                return

            try:
                bug = self.launchpad.bugs[params]
                task = bug.bug_tasks[len(bug.bug_tasks) - 1]

                self.irc.reply(
                    "LP %s [Status: %s, Assignee: %s] %s" %
                    (task.title, task.status,
                     self._find_name(task.assignee_link), bug.web_link))
            except Exception:
                return
示例#5
0
 def keyword_task(self, params=None, **kwargs):
     """Retrieve VersionOne task information (ex: TK-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Task", "TK-%s" % params)
示例#6
0
 def keyword_goal(self, params=None, **kwargs):
     """Retrieve VersionOne goal information (ex: G-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Goal", "G-%s" % params)
示例#7
0
 def keyword_defect(self, params=None, **kwargs):
     """Retrieve VersionOne defect information (ex: D-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Defect", "D-%s" % params)
示例#8
0
 def keyword_backlog(self, params=None, **kwargs):
     """Retrieve VersionOne backlog information (ex: B-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Story", "B-%s" % params)
示例#9
0
 def keyword_request(self, params=None, **kwargs):
     """Retrieve VersionOne request information (ex: R-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Request", "R-%s" % params)
示例#10
0
 def keyword_issue(self, params=None, **kwargs):
     """Retrieve VersionOne issue information (ex: I-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Issue", "I-%s" % params)
示例#11
0
 def keyword_defect(self, params=None, **kwargs):
     """Retrieve VersionOne defect information (ex: D-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Defect", "D-%s" % params)
示例#12
0
 def keyword_rmv(self, params=None, **kwargs):
     """Retrieve Verbose Redmine bug information (ex: RM12345)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_issue(params,verbose=True)
示例#13
0
 def keyword_backlog(self, params=None, **kwargs):
     """Retrieve VersionOne backlog information (ex: B-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Story", "B-%s" % params)
示例#14
0
 def keyword_rm(self, params=None, **kwargs):
     """Retrieve Redmine bug information (ex: RM12345)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_issue(params)
示例#15
0
 def keyword_task(self, params=None, **kwargs):
     """Retrieve VersionOne task information (ex: TK-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Task", "TK-%s" % params)
示例#16
0
 def test_ensure_int_3(self):
     self.assertEqual(utils.ensure_int("a"), None)
示例#17
0
 def test_ensure_int(self):
     self.assertEqual(utils.ensure_int("3"), 3)
示例#18
0
 def keyword_request(self, params=None, **kwargs):
     """Retrieve VersionOne request information (ex: R-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Request", "R-%s" % params)
示例#19
0
 def test_ensure_int_2(self):
     self.assertEqual(utils.ensure_int("\W"), None)
示例#20
0
 def keyword_epic(self, params=None, **kwargs):
     """Retrieve VersionOne epic information (ex: E-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Epic", "E-%s" % params)
示例#21
0
文件: redmine.py 项目: comstud/pyhole
 def keyword_rm(self, params=None, **kwargs):
     """Retrieve Redmine bug information (ex: RM12345)"""
     if params:
         params = utils.ensure_int(params)
         self._find_issue(params)
示例#22
0
 def test_ensure_int(self):
     self.assertEqual(utils.ensure_int("3"), 3)
示例#23
0
 def keyword_goal(self, params=None, **kwargs):
     """Retrieve VersionOne goal information (ex: G-01234)"""
     if params and not self.disabled:
         params = utils.ensure_int(params)
         if params:
             self._find_asset("Goal", "G-%s" % params)