Skip to content

Commit b766298

Browse files
committed
Misc code cleanup
1 parent 7037c53 commit b766298

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

src/classes/app.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,6 @@ def onLogTheEnd():
292292
log.info(time.asctime().center(48))
293293
log.info("================================================")
294294
except Exception:
295-
from classes.logger import log
295+
import logging
296+
log = logging.getLogger("OpenShot")
296297
log.warning('Failed to write session ended log')

src/classes/exceptions.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
"""
1+
"""
22
@file
33
@brief This file deals with unhandled exceptions
44
@author Jonathan Thomas <[email protected]>
5-
5+
66
@section LICENSE
7-
7+
88
Copyright (c) 2008-2018 OpenShot Studios, LLC
99
(http://www.openshotstudios.com). This file is part of
1010
OpenShot Video Editor (http://www.openshot.org), an open-source project
1111
dedicated to delivering high quality video editing and animation solutions
1212
to the world.
13-
13+
1414
OpenShot Video Editor is free software: you can redistribute it and/or modify
1515
it under the terms of the GNU General Public License as published by
1616
the Free Software Foundation, either version 3 of the License, or
1717
(at your option) any later version.
18-
18+
1919
OpenShot Video Editor is distributed in the hope that it will be useful,
2020
but WITHOUT ANY WARRANTY; without even the implied warranty of
2121
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2222
GNU General Public License for more details.
23-
23+
2424
You should have received a copy of the GNU General Public License
2525
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2626
"""

src/classes/timeline.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
"""
1+
"""
22
@file
33
@brief This file contains a timeline object, which listens for updates and syncs a libopenshot timeline object
44
@author Jonathan Thomas <[email protected]>
5-
5+
66
@section LICENSE
7-
7+
88
Copyright (c) 2008-2018 OpenShot Studios, LLC
99
(http://www.openshotstudios.com). This file is part of
1010
OpenShot Video Editor (http://www.openshot.org), an open-source project
1111
dedicated to delivering high quality video editing and animation solutions
1212
to the world.
13-
13+
1414
OpenShot Video Editor is free software: you can redistribute it and/or modify
1515
it under the terms of the GNU General Public License as published by
1616
the Free Software Foundation, either version 3 of the License, or
1717
(at your option) any later version.
18-
18+
1919
OpenShot Video Editor is distributed in the hope that it will be useful,
2020
but WITHOUT ANY WARRANTY; without even the implied warranty of
2121
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2222
GNU General Public License for more details.
23-
23+
2424
You should have received a copy of the GNU General Public License
2525
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2626
"""

src/windows/main_window.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ def keyPressEvent(self, event):
16891689

16901690
# If we didn't act on the event, forward it to the base class
16911691
else:
1692-
super(MainWindow, self).keyPressEvent(event)
1692+
super().keyPressEvent(event)
16931693

16941694

16951695
def actionProfile_trigger(self, event):
@@ -2602,10 +2602,10 @@ def ExportFinished(self, path):
26022602
except Exception:
26032603
log.debug('Failed to notify unity launcher of export progress. Completed.')
26042604

2605-
def __init__(self, mode=None):
2605+
def __init__(self, *args, mode=None):
26062606

26072607
# Create main window base class
2608-
QMainWindow.__init__(self)
2608+
super().__init__(*args)
26092609
self.mode = mode # None or unittest (None is normal usage)
26102610
self.initialized = False
26112611

src/windows/preview_thread.py

-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
2626
"""
2727

28-
import os
2928
import time
3029
import sip
3130

@@ -35,9 +34,7 @@
3534

3635
from classes.app import get_app
3736
from classes.logger import log
38-
from classes import settings
3937

40-
import json
4138

4239
class PreviewParent(QObject):
4340
""" Class which communicates with the PlayerWorker Class (running on a separate thread) """
@@ -226,7 +223,6 @@ def LoadFile(self, path=None):
226223
return
227224

228225
log.info("LoadFile %s" % path)
229-
s = settings.get_settings()
230226

231227
# Determine the current frame of the timeline (when switching to a clip)
232228
seek_position = 1
@@ -248,7 +244,6 @@ def LoadFile(self, path=None):
248244
seek_position = self.original_position
249245
else:
250246
# Create new timeline reader (to preview selected clip)
251-
s = settings.get_settings()
252247
project = get_app().project
253248

254249
# Get some settings from the project

src/windows/views/webview.py

+2
Original file line numberDiff line numberDiff line change
@@ -3102,6 +3102,8 @@ def render_cache_json(self):
31023102

31033103
def __init__(self, window):
31043104
super().__init__()
3105+
self.setObjectName("TimelineWebView")
3106+
31053107
self.window = window
31063108
self.setAcceptDrops(True)
31073109
self.last_position_frames = None

0 commit comments

Comments
 (0)