Exemplo n.º 1
0
 def __init__(self, bug_dict, connection=None):
     self.__data = bug_dict
     for i in ("tags", "duplicates"):
         self.__data[i] = self.__data[i].split()
     self.__data["bugnumber"] = int(bug_dict["bug"])
     del self.__data["bug"]
     self.__data["reporter"] = user.parse_text_user(self.__data["reporter"])
     self.__data["subscribers"] = [user.parse_text_user(u) for u in self.__data["subscribers"].split("\n") if u]
     
     self.__data["description"] = ""
     for i in ("date-reported", "date-updated"):
         self.__data[i] = LPTime(self.__data[i])
     a = list()
     for i in [i for i in self.__data["attachments"].split("\n") if i]:
         try:
             url, contenttype = i.split(" ", 1)
         except ValueError:
             if not i.startswith("http://"):
                 continue
             else:
                 raise
         contenttype = contenttype.split(";")[0]
         a.append(Attachment(url, contenttype, connection, self.__data["bugnumber"]))
     self.__data["attachments"] = Attachments(a)
Exemplo n.º 2
0
 def __init__(self, task_dict):
             
     #print task_dict
     task_dict["affects"], task_dict["targeted_to"] = product.parse_text_product(task_dict["task"])
     for i in ("reporter", "assignee"):
         task_dict[i] = user.parse_text_user(task_dict[i])
     for i in ("date-created", "date-confirmed", "date-assigned",
               "date-inprogress", "date-closed", "date-left-new",
               "date-incomplete", "date-triaged", "date-fix-committed",
               "date-fix-released"):
         if task_dict.has_key(i):
             task_dict[i] = LPTime(task_dict[i])
         else:
             task_dict[i] = None
     task_dict["remote"] = task_dict.get("watch", None)
     #print task_dict
     LPTask.__init__(self, task_dict)
Exemplo n.º 3
0
 def __init__(self, nr, author, date, comment):
     LPComment.__init__(self,text=comment)
     self.set_attr(nr=nr, user=user.parse_text_user(author[0]), date=LPTime(date[0]))