26
26
"""
27
27
28
28
import os
29
- import sys
30
29
import time
31
30
import json
32
- import operator
33
31
import functools
34
32
35
33
from PyQt5 .QtCore import *
36
- from PyQt5 .QtGui import QIcon , QStandardItemModel , QStandardItem , QBrush , QPalette
34
+ from PyQt5 .QtGui import QBrush
37
35
from PyQt5 .QtWidgets import *
38
- from PyQt5 import uic
39
36
import openshot # Python module for libopenshot (required video editing module installed separately)
40
37
41
38
from classes import info , ui_util , settings , qt_types , updates
@@ -52,7 +49,7 @@ class ProcessEffect(QDialog):
52
49
ui_path = os .path .join (info .PATH , 'windows' , 'ui' , 'process-effect.ui' )
53
50
54
51
def __init__ (self , clip_id , effect_name , effect_params ):
55
-
52
+
56
53
if not openshot .Clip ().COMPILED_WITH_CV :
57
54
raise ModuleNotFoundError ("Openshot not compiled with OpenCV" )
58
55
@@ -319,20 +316,20 @@ def accept(self):
319
316
processing = openshot .ClipProcessingJobs (self .effect_name , jsonString )
320
317
processing .processClip (self .clip_instance , jsonString )
321
318
322
- # TODO: This is just a temporary fix. We need to find a better way to allow the user to fix the error
323
- # The while loop is handling the error message. If pre-processing returns an error, a message
319
+ # TODO: This is just a temporary fix. We need to find a better way to allow the user to fix the error
320
+ # The while loop is handling the error message. If pre-processing returns an error, a message
324
321
# will be displayed for 3 seconds and the effect will be closed.
325
322
start = time .time ()
326
323
while processing .GetError ():
327
324
self .error_label .setText (processing .GetErrorMessage ())
328
325
self .error_label .repaint ()
329
- if (time .time ()- start )> 3 :
326
+ if (time .time () - start ) > 3 :
330
327
self .exporting = False
331
328
processing .CancelProcessing ()
332
329
while (not processing .IsDone () ):
333
330
continue
334
331
super (ProcessEffect , self ).reject ()
335
-
332
+
336
333
# get processing status
337
334
while (not processing .IsDone () ):
338
335
# update progressbar
@@ -348,12 +345,12 @@ def accept(self):
348
345
processing .CancelProcessing ()
349
346
350
347
if (not self .cancel_clip_processing ):
351
-
348
+
352
349
# Load processed data into effect
353
350
self .effect = openshot .EffectInfo ().CreateEffect (self .effect_name )
354
351
self .effect .SetJson ( '{"protobuf_data_path": "%s"}' % protobufPath )
355
352
self .effect .Id (ID )
356
-
353
+
357
354
# Accept dialog
358
355
super (ProcessEffect , self ).accept ()
359
356
0 commit comments