Ejemplo n.º 1
0
    def draw(self):
    
        # get current buffer!
        b = utils.get_buffer(self.buffer_name)

        # set to markdown syntax for now
        vim.command("set filetype=markdown")

        # append title
        b.append("## %s" % self.repo)
        b.append("")
        
        for i in self.issues:
            issue_string = "%s. \"%s\" " % (i[0], i[1])

            if len(i[5]) > 0:
                 issue_string += "#%s " % ",".join(i[5])
            
            if not (i[2] == github.user()["login"]):
                issue_string += "@%s " % i[2]
            if not (i[3] == "open"):
                issue_string += i[3]
            
            # add labels if they exist
            b.append(issue_string)

        # delete first line
        vim.command("1delete _")
Ejemplo n.º 2
0
    def draw(self):

        self.buffer_name = "%s/%s" % (self.repo, self.number)
        b = utils.get_buffer(self.buffer_name)
        vim.command("1,$d")
        vim.command("set filetype=markdown")

        # print out issue
        b.append("## %s # %s" % (self.repo, self.number))
        b.append("")

        # iterate through all keys that aren't body
        keys = self.data.keys()
        keys.remove("body")
        for key in keys:
            value = self.data[key]
            if type(value) == list:
                value = ",".join(value)
            b.append("# %s: %s" % (key.capitalize(), value))

        # print out body if applicable
        if self.data.has_key("body") and self.data["body"]:
            for line in self.data["body"].splitlines():
                b.append(line)

        # now we need to print the comments
        self.comments.draw(b)
        # remove leading line
        vim.command("1delete _")