Exemplo n.º 1
0
 def produce_schedule(self):
     """
     moves files and creates a schedule
     """
     destination_path = "F:\\mp4s"
     ql = QuickList()
     ql.header = ["title",
                  "year",
                  "nice_title",
                  "film_ident",
                  "timestamp",
                  "original_name",
                  "file_name",
                  "delete",
                  "trim"]
     
     for x,c in enumerate(self.clips()):
         print c
         old_name = c
         seconds = float(c.replace(".mp4","").replace("clip_",""))
         m, s = divmod(seconds, 60)
         h, m = divmod(m, 60)
         timestamp = "%d:%02d:%02d" % (h, m, s)            
         
         file_name = self.ident + "_{0}.mp4".format(x)
         
         shutil.copyfile(os.path.join(self.clip_dir,old_name),
                         os.path.join(destination_path,file_name))
         
         row = [self.title,
                self.date,
                self.nice_name,
                self.ident,
                timestamp,
                old_name,
                file_name,
                "",
                "",
                ]
         ql.add(row)
         
         
     ql.save(os.path.join(self.dir,"schedule.xls"))
     return ql