Diff of /trunk/tubetutor/tubetutor.py [r8] .. [r9]  Maximize  Restore

Switch to unified view

a/trunk/tubetutor/tubetutor.py b/trunk/tubetutor/tubetutor.py
...
...
117
117
118
    def refresh_files(self):
118
    def refresh_files(self):
119
        self.files = []
119
        self.files = []
120
        for root, dirs, files in os.walk(os.path.join(self.path, "working")):
120
        for root, dirs, files in os.walk(os.path.join(self.path, "working")):
121
            for file in files:
121
            for file in files:
122
                if file.endswith(".mkv") or file.endswith(".txt"):
122
                if file.endswith(".mkv") or file.endswith(".mp4") or file.endswith(".txt"):
123
                    self.files.append(os.path.join(root, file))
123
                    self.files.append(os.path.join(root, file))
124
        self.files.sort()
124
        self.files.sort()
125
125
126
    # Output the main window
126
    # Output the main window
127
    def refresh_display(self):
127
    def refresh_display(self):
...
...
182
            pass
182
            pass
183
        self.add_text(id(file), content);
183
        self.add_text(id(file), content);
184
        for file in self.files:
184
        for file in self.files:
185
            if os.path.basename(file).startswith("tmp_"):
185
            if os.path.basename(file).startswith("tmp_"):
186
                continue
186
                continue
187
          if file.endswith(".mkv"):
187
          if file.endswith(".mkv") or file.endswith(".mp4"):
188
                self.start_frame()
188
                self.start_frame()
189
                moviefile=file
189
                moviefile=file
190
                self.add_label(id(file) + "_image", image=os.path.join("media", "movie.png"), side=tkinter.LEFT)
190
                self.add_label(id(file) + "_image", image=os.path.join("media", "movie.png"), side=tkinter.LEFT)
191
                self.add_label(id(file), text=file, side=tkinter.LEFT)
191
                self.add_label(id(file), text=file, side=tkinter.LEFT)
192
                self.add_button("del", lambda: self.delete(moviefile), side=tkinter.LEFT)
192
                self.add_button("del", lambda: self.delete(moviefile), side=tkinter.LEFT)
...
...
301
        for file in self.files:
301
        for file in self.files:
302
            if os.path.basename(file).startswith("tmp_"):
302
            if os.path.basename(file).startswith("tmp_"):
303
                continue
303
                continue
304
            if file.endswith(".txt"):
304
            if file.endswith(".txt"):
305
                description += "- %s" % r.add_text(file)
305
                description += "- %s" % r.add_text(file)
306
          if file.endswith(".mkv"):
306
          if file.endswith(".mkv") or file.endswith(".mp4"):
307
                r.add_video(file)
307
                r.add_video(file)
308
        r.concat(os.path.join(path, "tmp", "concat.mkv"))
308
        r.concat(os.path.join(path, "tmp", "concat.mkv"), audio=True)
309
        r.speedup(os.path.join(path, "tmp", "speedup.mkv"), 0.7)
309
        #r.speedup(os.path.join(path, "tmp", "speedup.mkv"), 0.7)
310
        r.mux(os.path.join(path, "tmp", "main.mkv"), os.path.join("media", "back.mp3"))
310
        r.mux(os.path.join(path, "tmp", "main.mkv"), os.path.join("media", "back.mp3"))
311
        videos.append(r.lastfilename)
311
        videos.append(r.lastfilename)
312
312
313
        # outro
313
        # outro
314
        if os.path.exists(os.path.join("media", "outro.mkv")):
314
        if os.path.exists(os.path.join("media", "outro.mkv")):