Esempio n. 1
0
    def do_download(self, args):
        successful = True
        if not args.all:
            if not args.save_type:
                args.save_type = self.filesystem.get_json_filename_type(
                    args.id)
            if not args.save_type:
                return 1, "Unable to determine type of id %s" % args.id
            successful = tts.download_file(self.filesystem, args.id,
                                           args.save_type)
        else:
            if args.save_type:
                for ident in self.filesystem.get_filenames_by_type(
                        args.save_type):
                    if not tts.download_file(self.filesystem, ident,
                                             args.save_type):
                        successful = False
                        break
            else:
                for save_type in tts.SaveType:
                    for ident in self.filesystem.get_filenames_by_type(
                            save_type):
                        if not tts.download_file(self.filesystem, ident,
                                                 save_type):
                            successful = False
                            break

        if successful:
            return 0, "All files downloaded."
        else:
            return 1, "Some files failed to download."
Esempio n. 2
0
  def do_download(self,args):
    successful=True
    if not args.all:
      if not args.save_type:
        args.save_type=self.filesystem.get_json_filename_type(args.id)
      if not args.save_type:
        return 1,"Unable to determine type of id %s" % args.id
      successful = tts.download_file(self.filesystem,args.id,args.save_type)
    else:
      if args.save_type:
        for ident in self.filesystem.get_filenames_by_type(args.save_type):
          if not tts.download_file(self.filesystem,ident,args.save_type):
            successful=False
            break
      else:
        for save_type in tts.SaveType:
          for ident in self.filesystem.get_filenames_by_type(save_type):
            if not tts.download_file(self.filesystem,ident,save_type):
              successful=False
              break

    if successful:
      return 0, "All files downloaded."
    else:
      return 1, "Some files failed to download."
Esempio n. 3
0
 def download_all(self):
     successful = True
     save_type = {1: tts.SaveType.workshop, 2: tts.SaveType.save, 3: tts.SaveType.chest}[
         self.download_sb.save_type.get()
     ]
     for ident in self.download_sb.file_store.values():
         successful = tts.download_file(self.filesystem, ident, save_type)
         if not successful:
             break
     if successful:
         messagebox.showinfo("TTS Manager", "All files downloaded successfully.")
     else:
         messagebox.showinfo("TTS Manager", "Some downloads failed (see log).")
Esempio n. 4
0
 def download_all(self):
     successful = True
     save_type = {
         1: tts.SaveType.workshop,
         2: tts.SaveType.save,
         3: tts.SaveType.chest
     }[self.download_sb.save_type.get()]
     for ident in self.download_sb.file_store.values():
         successful = tts.download_file(self.filesystem, ident, save_type)
         if not successful:
             break
     if successful:
         messagebox.showinfo("TTS Manager",
                             "All files downloaded successfully.")
     else:
         messagebox.showinfo("TTS Manager",
                             "Some downloads failed (see log).")