Ejemplo n.º 1
0
 def run(self):
     title, body = self.get_title_body()
     tags = [t for t in self.args.tags.split(",") if t] # Filter out any empty strings
     issue = self.backend.add_issue(title, body, tags=tags)
     print("Issue added!")
     print()
     util.print_issue(issue[0], issue[1])
Ejemplo n.º 2
0
 def run(self):
     message = self.args.message
     if (message is None):
         message, exit_status = util.get_string_from_editor("Please resolve this issue.", prefix='idli-assign-')
         if (exit_status != 0):
             raise idli.IdliException("Operation cancelled.")
     issue = self.backend.assign_issue(self.args.id, user=self.args.user, message = message)
     issue, comments = self.backend.get_issue(self.args.id)
     print("Issue " + self.args.id + " assigned to " + str(self.args.user))
     print()
     util.print_issue(issue, comments)
Ejemplo n.º 3
0
 def run(self):
     message = self.args.message
     message = self.args.message
     if (message is None):
         message, exit_status = util.get_string_from_editor("Issue resolved.\n# More details go here.", prefix='idli-resolve-')
         if (exit_status != 0):
             raise idli.IdliException("Operation cancelled.")
     issue = self.backend.resolve_issue(self.args.id, status = self.args.state, message = message)
     issue, comments = self.backend.get_issue(self.args.id)
     print("Issue state changed to " + str(self.args.state))
     print()
     util.print_issue(issue, comments)
Ejemplo n.º 4
0
 def run(self):
     issue = self.backend.get_issue(self.args.id) # Will raise error message if issue cannot be found
     message = self.args.body
     if (message is None):
         message, exit_status = util.get_string_from_editor("# Type your comment here.", prefix='idli-comment-')
         if (exit_status != 0):
             raise idli.IdliException("Operation cancelled.")
     self.backend.add_comment(self.args.id, message)
     print("Comment added!")
     print()
     issue, comments = self.backend.get_issue(self.args.id)
     util.print_issue(issue, comments)
Ejemplo n.º 5
0
    def run(self):
        issue, comments = self.backend.get_issue(self.args.id) # This will raise an error if the issue does not exist.
        tags = [t for t in (self.args.tags).split(",") if t] # Remove empty tags

        if self.args.remove: #If user asked to remove nonexistent tag, raise an error.
            for t in tags:
                if not (t in issue.tags):
                    raise idli.IdliException("The issue " + str(self.args.id) + " does not have the tag " + t + ". No action performed. Tags available: " + ", ".join(issue.tags))
                tags = [t for t in tags if not (t in issue.tags)]

        #Now actually tag the issue.
        self.backend.tag_issue(self.args.id, tags, self.args.remove)
        issue,comments = self.backend.get_issue(self.args.id)
        util.print_issue(issue, comments)
Ejemplo n.º 6
0
 def run(self):
     issue, comments = self.backend.get_issue(self.args.id)
     util.print_issue(issue, comments)
Ejemplo n.º 7
0
 def run(self):
     issue, comments = self.backend.get_issue(self.args.id)
     util.print_issue(issue, comments)