Example #1
0
    def get_plaintext_body_by_id(self, id):
        if id < len(self.conversations) and self.conversations[id].magic_ext == "GZ":
            data, name = CTCore.ungzip(id)
        else:
            data = self.get_body_by_id(id)

        return data
Example #2
0
    def get_plaintext_body_by_id(self, id):
        if id < len(self.conversations
                    ) and self.conversations[id].magic_ext == "GZ":
            data, name = CTCore.ungzip(id)
        else:
            data = self.get_body_by_id(id)

        return data
Example #3
0
 def do_ungzip(self,line):
     try:
         l = line.split(" ")
         if (l[0] == ""):
             self.help_ungzip()
         else:
             if l[0].lower() == "all":
                 CTCore.ungzip_all()
             else:
                 id = int(l[0])
                 if in_range(id):
                     obj_num, name = CTCore.ungzip(id)
                     if obj_num != -1:
                         print " GZIP Decompression of object {} ({}) successful!".format(str(id), name)
                         print " New object created: {}".format(obj_num) + newLine
                     else:
                         CTCore.show_errors()
     except Exception,e:
         print str(e)
Example #4
0
 def do_ungzip(self, line):
     try:
         l = line.split(" ")
         if (l[0] == ""):
             self.help_ungzip()
         else:
             if l[0].lower() == "all":
                 CTCore.ungzip_all()
             else:
                 id = int(l[0])
                 if in_range(id):
                     obj_num, name = CTCore.ungzip(id)
                     if obj_num != -1:
                         print " GZIP Decompression of object {} ({}) successful!".format(
                             str(id), name)
                         print " New object created: {}".format(
                             obj_num) + newLine
                     else:
                         CTCore.show_errors()
     except Exception, e:
         print str(e)