[pitivi] Fix imports order and form using pre-commit
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Fix imports order and form using pre-commit
- Date: Thu, 7 Apr 2016 12:40:45 +0000 (UTC)
commit d64c3582f1719754df8f24359ad174ba95de44e7
Author: Thibault Saunier <tsaunier gnome org>
Date: Wed Apr 6 16:53:50 2016 +0200
Fix imports order and form using pre-commit
pitivi/application.py | 22 ++++++++++-------
pitivi/autoaligner.py | 7 ++---
pitivi/clipproperties.py | 16 +++++++-----
pitivi/dialogs/clipmediaprops.py | 11 ++++----
pitivi/dialogs/depsmanager.py | 5 +--
pitivi/dialogs/filelisterrordialog.py | 5 +---
pitivi/dialogs/prefs.py | 3 --
pitivi/dialogs/startupwizard.py | 6 +---
pitivi/effects.py | 18 +++++++-------
pitivi/mainwindow.py | 24 ++++++++++++------
pitivi/mediafilespreviewer.py | 9 ++++---
pitivi/medialibrary.py | 33 ++++++++++++++++----------
pitivi/preset.py | 10 ++++----
pitivi/project.py | 37 ++++++++++++++++++-----------
pitivi/render.py | 18 ++++++++------
pitivi/settings.py | 3 +-
pitivi/tabsmanager.py | 6 ++--
pitivi/timeline/__init__.py | 1 -
pitivi/timeline/elements.py | 23 ++++++++----------
pitivi/timeline/layer.py | 10 +++----
pitivi/timeline/previewers.py | 7 ++---
pitivi/timeline/ruler.py | 12 +++++----
pitivi/timeline/timeline.py | 40 ++++++++++++++++++++-----------
pitivi/titleeditor.py | 11 ++++----
pitivi/transitions.py | 9 +++----
pitivi/undo/timeline.py | 10 ++++----
pitivi/undo/undo.py | 2 -
pitivi/utils/extract.py | 7 ++---
pitivi/utils/loggable.py | 9 +++----
pitivi/utils/misc.py | 14 ++++++----
pitivi/utils/pipeline.py | 6 +---
pitivi/utils/proxy.py | 5 +--
pitivi/utils/system.py | 2 -
pitivi/utils/threads.py | 1 -
pitivi/utils/timeline.py | 3 +-
pitivi/utils/ui.py | 30 ++++++++++++-----------
pitivi/utils/validate.py | 8 +++---
pitivi/utils/widgets.py | 26 +++++++++++---------
pitivi/viewer/move_scale_overlay.py | 5 +--
pitivi/viewer/overlay.py | 2 -
pitivi/viewer/overlay_stack.py | 4 +--
pitivi/viewer/title_overlay.py | 1 -
pitivi/viewer/viewer.py | 3 +-
tests/__init__.py | 1 -
tests/common.py | 9 +++----
tests/runtests.py | 2 -
tests/test_application.py | 4 +--
tests/test_check.py | 4 +--
tests/test_clipproperties.py | 1 -
tests/test_common.py | 4 +--
tests/test_log.py | 5 ----
tests/test_mainwindow.py | 4 ---
tests/test_media_library.py | 7 +----
tests/test_misc.py | 1 -
tests/test_pipeline.py | 4 +--
tests/test_prefs.py | 1 -
tests/test_preset.py | 6 +---
tests/test_previewers.py | 8 ++----
tests/test_project.py | 8 +++---
tests/test_system.py | 11 +++++---
tests/test_timeline_layer.py | 4 +--
tests/test_timeline_timeline.py | 7 ++---
tests/test_undo.py | 8 ++++--
tests/test_undo_timeline.py | 14 +++++-----
tests/test_utils.py | 4 +-
tests/test_utils_timeline.py | 12 +++++----
tests/test_widgets.py | 9 +++++-
tests/validate-tests/pitivi.py | 1 -
tests/validate-tests/pitivivalidate.py | 8 ++++--
win32/configure.py | 1 -
70 files changed, 313 insertions(+), 319 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 0f7b978..eb9a699 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -21,30 +21,34 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import time
-from gi.repository import GObject
from gi.repository import Gio
-from gi.repository import Gtk
+from gi.repository import GObject
from gi.repository import Gst
+from gi.repository import Gtk
-from pitivi.configure import VERSION, RELEASES_URL, in_devel
+from pitivi.configure import in_devel
+from pitivi.configure import RELEASES_URL
+from pitivi.configure import VERSION
from pitivi.dialogs.startupwizard import StartUpWizard
from pitivi.effects import EffectsManager
from pitivi.mainwindow import PitiviMainWindow
-from pitivi.project import ProjectManager, ProjectLogObserver
-from pitivi.settings import GlobalSettings, xdg_cache_home, get_dir
+from pitivi.project import ProjectLogObserver
+from pitivi.project import ProjectManager
+from pitivi.settings import get_dir
+from pitivi.settings import GlobalSettings
+from pitivi.settings import xdg_cache_home
from pitivi.undo.timeline import TimelineLogObserver
from pitivi.undo.undo import UndoableActionLog
-from pitivi.utils.threads import ThreadMaster
-
from pitivi.utils import loggable
from pitivi.utils.loggable import Loggable
-from pitivi.utils.misc import quote_uri, path_from_uri
+from pitivi.utils.misc import path_from_uri
+from pitivi.utils.misc import quote_uri
from pitivi.utils.proxy import ProxyManager
from pitivi.utils.system import getSystem
+from pitivi.utils.threads import ThreadMaster
from pitivi.utils.timeline import Zoomable
diff --git a/pitivi/autoaligner.py b/pitivi/autoaligner.py
index 3932ffa..6973da9 100644
--- a/pitivi/autoaligner.py
+++ b/pitivi/autoaligner.py
@@ -18,18 +18,17 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
# TODO reimplement after GES port
"""
Classes for automatic alignment of L{Clip}s
"""
+import array
+import os
+import time
from gi.repository import GObject
from gi.repository import Gst
-import array
-import time
from gi.repository import Gtk
-import os
try:
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index abe0fe3..9ec121e 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -21,23 +21,25 @@
"""
Widgets to control clips properties
"""
-
import os
-
from gettext import gettext as _
-from gi.repository import GES
from gi.repository import Gdk
+from gi.repository import GES
from gi.repository import Gio
from gi.repository import Gtk
from gi.repository import Pango
from pitivi.configure import get_ui_dir
-from pitivi.effects import AUDIO_EFFECT, VIDEO_EFFECT, HIDDEN_EFFECTS, \
- EffectsPropertiesManager
+from pitivi.effects import AUDIO_EFFECT
+from pitivi.effects import EffectsPropertiesManager
+from pitivi.effects import HIDDEN_EFFECTS
+from pitivi.effects import VIDEO_EFFECT
from pitivi.utils.loggable import Loggable
-from pitivi.utils.ui import EFFECT_TARGET_ENTRY, PADDING, SPACING, \
- disable_scroll
+from pitivi.utils.ui import disable_scroll
+from pitivi.utils.ui import EFFECT_TARGET_ENTRY
+from pitivi.utils.ui import PADDING
+from pitivi.utils.ui import SPACING
(COL_ACTIVATED,
COL_TYPE,
diff --git a/pitivi/dialogs/clipmediaprops.py b/pitivi/dialogs/clipmediaprops.py
index 6079539..6035d0a 100644
--- a/pitivi/dialogs/clipmediaprops.py
+++ b/pitivi/dialogs/clipmediaprops.py
@@ -16,18 +16,19 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
-
import os
+from gettext import gettext as _
from gi.repository import Gdk
from gi.repository import Gst
from gi.repository import Gtk
-from gettext import gettext as _
-
from pitivi.configure import get_ui_dir
-from pitivi.utils.ui import frame_rates, audio_rates, \
- audio_channels, pixel_aspect_ratios, get_value_from_model
+from pitivi.utils.ui import audio_channels
+from pitivi.utils.ui import audio_rates
+from pitivi.utils.ui import frame_rates
+from pitivi.utils.ui import get_value_from_model
+from pitivi.utils.ui import pixel_aspect_ratios
class ClipMediaPropsDialog(object):
diff --git a/pitivi/dialogs/depsmanager.py b/pitivi/dialogs/depsmanager.py
index d8d6dbc..dcee257 100644
--- a/pitivi/dialogs/depsmanager.py
+++ b/pitivi/dialogs/depsmanager.py
@@ -19,14 +19,13 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
""" This module implements the notions of missing dependencies """
+import os
from gi.repository import Gtk
-import os
-from pitivi.configure import get_ui_dir
from pitivi.check import missing_soft_deps
+from pitivi.configure import get_ui_dir
class DepsManager(object):
diff --git a/pitivi/dialogs/filelisterrordialog.py b/pitivi/dialogs/filelisterrordialog.py
index ddfe56e..9801571 100644
--- a/pitivi/dialogs/filelisterrordialog.py
+++ b/pitivi/dialogs/filelisterrordialog.py
@@ -18,20 +18,17 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
Dialog box listing files which had errors, and the reasons.
"""
-
import os
+from gettext import gettext as _
from urllib.parse import unquote
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Pango
-from gettext import gettext as _
-
from pitivi.configure import get_ui_dir
from pitivi.utils.loggable import Loggable
diff --git a/pitivi/dialogs/prefs.py b/pitivi/dialogs/prefs.py
index 01a7a40..0747d33 100644
--- a/pitivi/dialogs/prefs.py
+++ b/pitivi/dialogs/prefs.py
@@ -18,13 +18,10 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
Dialog box for user preferences.
"""
-
import os
-
from gettext import gettext as _
from gi.repository import Gtk
diff --git a/pitivi/dialogs/startupwizard.py b/pitivi/dialogs/startupwizard.py
index b370a6f..d447715 100644
--- a/pitivi/dialogs/startupwizard.py
+++ b/pitivi/dialogs/startupwizard.py
@@ -18,14 +18,12 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
+from gettext import gettext as _
-from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GES
-
-from gettext import gettext as _
+from gi.repository import Gtk
from pitivi.check import missing_soft_deps
from pitivi.configure import get_ui_dir
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 330e491..b4b04bb 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -19,7 +19,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
Effects global handling
Note: Some effects are available through the frei0r
@@ -34,24 +33,25 @@ Effects global handling
that are too cumbersome to use as such
_ Complex Audio/Video Effects
"""
-
import os
import re
+from gettext import gettext as _
+from gi.repository import Gdk
+from gi.repository import GdkPixbuf
from gi.repository import GLib
from gi.repository import Gst
from gi.repository import Gtk
-from gi.repository import Gdk
from gi.repository import Pango
-from gi.repository import GdkPixbuf
-
-from gettext import gettext as _
-from pitivi.configure import get_ui_dir, get_pixmap_dir
+from pitivi.configure import get_pixmap_dir
+from pitivi.configure import get_ui_dir
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
-from pitivi.utils.ui import EFFECT_TARGET_ENTRY, SPACING
-from pitivi.utils.widgets import GstElementSettingsWidget, FractionWidget
+from pitivi.utils.ui import EFFECT_TARGET_ENTRY
+from pitivi.utils.ui import SPACING
+from pitivi.utils.widgets import FractionWidget
+from pitivi.utils.widgets import GstElementSettingsWidget
(VIDEO_EFFECT, AUDIO_EFFECT) = list(range(1, 3))
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index a3b9d73..039bc83 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -19,7 +19,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import subprocess
from gettext import gettext as _
@@ -27,18 +26,22 @@ from hashlib import md5
from time import time
from urllib.parse import unquote
-from gi.repository import GES
from gi.repository import Gdk
+from gi.repository import GES
from gi.repository import Gio
from gi.repository import Gst
from gi.repository import GstPbutils
from gi.repository import Gtk
from pitivi.clipproperties import ClipProperties
-from pitivi.configure import in_devel, VERSION, APPNAME, APPURL, \
- get_pixmap_dir, get_ui_dir
-from pitivi.effects import EffectListWidget
+from pitivi.configure import APPNAME
+from pitivi.configure import APPURL
+from pitivi.configure import get_pixmap_dir
+from pitivi.configure import get_ui_dir
+from pitivi.configure import in_devel
+from pitivi.configure import VERSION
from pitivi.dialogs.prefs import PreferencesDialog
+from pitivi.effects import EffectListWidget
from pitivi.mediafilespreviewer import PreviewWidget
from pitivi.medialibrary import MediaLibraryWidget
from pitivi.settings import GlobalSettings
@@ -47,9 +50,14 @@ from pitivi.timeline.timeline import TimelineContainer
from pitivi.titleeditor import TitleEditor
from pitivi.transitions import TransitionsListWidget
from pitivi.utils.loggable import Loggable
-from pitivi.utils.misc import show_user_manual, path_from_uri
-from pitivi.utils.ui import clear_styles, beautify_length, \
- beautify_time_delta, info_name, SPACING, TIMELINE_CSS
+from pitivi.utils.misc import path_from_uri
+from pitivi.utils.misc import show_user_manual
+from pitivi.utils.ui import beautify_length
+from pitivi.utils.ui import beautify_time_delta
+from pitivi.utils.ui import clear_styles
+from pitivi.utils.ui import info_name
+from pitivi.utils.ui import SPACING
+from pitivi.utils.ui import TIMELINE_CSS
from pitivi.viewer.viewer import ViewerContainer
diff --git a/pitivi/mediafilespreviewer.py b/pitivi/mediafilespreviewer.py
index 4a158ab..7a72eb5 100644
--- a/pitivi/mediafilespreviewer.py
+++ b/pitivi/mediafilespreviewer.py
@@ -20,13 +20,12 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from gettext import gettext as _
-from gi.repository import GLib
-from gi.repository import GObject
from gi.repository import Gdk
from gi.repository import GdkPixbuf
+from gi.repository import GLib
+from gi.repository import GObject
from gi.repository import Gst
from gi.repository import GstPbutils
from gi.repository import Gtk
@@ -36,7 +35,9 @@ from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
from pitivi.utils.misc import uri_is_valid
from pitivi.utils.pipeline import AssetPipeline
-from pitivi.utils.ui import beautify_length, beautify_stream, SPACING
+from pitivi.utils.ui import beautify_length
+from pitivi.utils.ui import beautify_stream
+from pitivi.utils.ui import SPACING
from pitivi.viewer.viewer import ViewerWidget
PREVIEW_WIDTH = 250
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index c655950..fc43acd 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -21,41 +21,48 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import threading
import time
-
-from gettext import ngettext, gettext as _
+from gettext import gettext as _
+from gettext import ngettext
from hashlib import md5
from urllib.parse import unquote
from urllib.parse import urlparse
-from gi.repository import GES
-from gi.repository import GLib
-from gi.repository import GObject
from gi.repository import Gdk
from gi.repository import GdkPixbuf
+from gi.repository import GES
from gi.repository import Gio
+from gi.repository import GLib
+from gi.repository import GObject
from gi.repository import Gst
+from gi.repository import GstPbutils
from gi.repository import Gtk
from gi.repository import Pango
-from gi.repository import GstPbutils
from pitivi.check import missing_soft_deps
-from pitivi.configure import get_ui_dir, get_pixmap_dir
+from pitivi.configure import get_pixmap_dir
+from pitivi.configure import get_ui_dir
from pitivi.dialogs.clipmediaprops import ClipMediaPropsDialog
from pitivi.dialogs.filelisterrordialog import FileListErrorDialog
from pitivi.mediafilespreviewer import PreviewWidget
from pitivi.settings import GlobalSettings
from pitivi.timeline.previewers import getThumbnailCache
from pitivi.utils.loggable import Loggable
-from pitivi.utils.misc import PathWalker, quote_uri, path_from_uri,\
- get_proxy_target, disconnectAllByFunc
+from pitivi.utils.misc import disconnectAllByFunc
+from pitivi.utils.misc import get_proxy_target
+from pitivi.utils.misc import path_from_uri
+from pitivi.utils.misc import PathWalker
+from pitivi.utils.misc import quote_uri
from pitivi.utils.proxy import ProxyingStrategy
-from pitivi.utils.ui import beautify_asset, beautify_length, info_name, \
- URI_TARGET_ENTRY, FILE_TARGET_ENTRY, SPACING, \
- beautify_ETA
+from pitivi.utils.ui import beautify_asset
+from pitivi.utils.ui import beautify_ETA
+from pitivi.utils.ui import beautify_length
+from pitivi.utils.ui import FILE_TARGET_ENTRY
+from pitivi.utils.ui import info_name
+from pitivi.utils.ui import SPACING
+from pitivi.utils.ui import URI_TARGET_ENTRY
# Values used in the settings file.
SHOW_TREEVIEW = 1
diff --git a/pitivi/preset.py b/pitivi/preset.py
index 9c3193f..5c28150 100644
--- a/pitivi/preset.py
+++ b/pitivi/preset.py
@@ -18,19 +18,19 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import json
import os.path
+from gettext import gettext as _
from gi.repository import Gio
+from gi.repository import GObject
from gi.repository import Gst
from gi.repository import Gtk
-from gi.repository import GObject
-
-from gettext import gettext as _
+from pitivi.configure import get_audiopresets_dir
+from pitivi.configure import get_renderpresets_dir
+from pitivi.configure import get_videopresets_dir
from pitivi.settings import xdg_data_home
-from pitivi.configure import get_renderpresets_dir, get_audiopresets_dir, get_videopresets_dir
from pitivi.utils import system
from pitivi.utils.loggable import Loggable
diff --git a/pitivi/project.py b/pitivi/project.py
index fe35038..44c6e45 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -19,38 +19,47 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
Project related classes
"""
-
import datetime
import os
import pwd
import tarfile
import time
+from gettext import gettext as _
-from gi.repository import GstPbutils
from gi.repository import GES
-from gi.repository import Gst
-from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import GObject
-
-from gettext import gettext as _
+from gi.repository import Gst
+from gi.repository import GstPbutils
+from gi.repository import Gtk
from pitivi.configure import get_ui_dir
-from pitivi.preset import AudioPresetManager, VideoPresetManager
+from pitivi.preset import AudioPresetManager
+from pitivi.preset import VideoPresetManager
from pitivi.render import CachedEncoderList
from pitivi.undo.undo import UndoableAction
from pitivi.utils.loggable import Loggable
-from pitivi.utils.misc import quote_uri, path_from_uri, isWritable, unicode_error_dialog
-from pitivi.utils.pipeline import Pipeline, PipelineError
+from pitivi.utils.misc import isWritable
+from pitivi.utils.misc import path_from_uri
+from pitivi.utils.misc import quote_uri
+from pitivi.utils.misc import unicode_error_dialog
+from pitivi.utils.pipeline import Pipeline
+from pitivi.utils.pipeline import PipelineError
from pitivi.utils.ripple_update_group import RippleUpdateGroup
-from pitivi.utils.ui import frame_rates, audio_rates,\
- audio_channels, beautify_time_delta, get_combo_value, set_combo_value,\
- pixel_aspect_ratios, display_aspect_ratios, SPACING
-from pitivi.utils.validate import has_validate, create_monitor
+from pitivi.utils.ui import audio_channels
+from pitivi.utils.ui import audio_rates
+from pitivi.utils.ui import beautify_time_delta
+from pitivi.utils.ui import display_aspect_ratios
+from pitivi.utils.ui import frame_rates
+from pitivi.utils.ui import get_combo_value
+from pitivi.utils.ui import pixel_aspect_ratios
+from pitivi.utils.ui import set_combo_value
+from pitivi.utils.ui import SPACING
+from pitivi.utils.validate import create_monitor
+from pitivi.utils.validate import has_validate
from pitivi.utils.widgets import FractionWidget
diff --git a/pitivi/render.py b/pitivi/render.py
index 9908285..5b2bdd2 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -19,14 +19,13 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
Rendering-related utilities and classes
"""
-
import os
import subprocess
import time
+from gettext import gettext as _
from gi.repository import GES
from gi.repository import GLib
@@ -34,16 +33,19 @@ from gi.repository import GObject
from gi.repository import Gst
from gi.repository import Gtk
-from gettext import gettext as _
-
from pitivi import configure
-
from pitivi.check import missing_soft_deps
from pitivi.utils.loggable import Loggable
-from pitivi.utils.misc import show_user_manual, path_from_uri
+from pitivi.utils.misc import path_from_uri
+from pitivi.utils.misc import show_user_manual
from pitivi.utils.ripple_update_group import RippleUpdateGroup
-from pitivi.utils.ui import model, frame_rates, audio_rates,\
- audio_channels, get_combo_value, set_combo_value, beautify_ETA
+from pitivi.utils.ui import audio_channels
+from pitivi.utils.ui import audio_rates
+from pitivi.utils.ui import beautify_ETA
+from pitivi.utils.ui import frame_rates
+from pitivi.utils.ui import get_combo_value
+from pitivi.utils.ui import model
+from pitivi.utils.ui import set_combo_value
from pitivi.utils.widgets import GstElementSettingsDialog
diff --git a/pitivi/settings.py b/pitivi/settings.py
index c38f764..6195b79 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -18,9 +18,8 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-import os
import configparser
+import os
from gi.repository import GLib
from gi.repository import GObject
diff --git a/pitivi/tabsmanager.py b/pitivi/tabsmanager.py
index e821e1d..6ad5136 100644
--- a/pitivi/tabsmanager.py
+++ b/pitivi/tabsmanager.py
@@ -21,13 +21,13 @@
"""
A helper object to work with Gtk.Notebook tabs
"""
-
-from gi.repository import Gtk
from gi.repository import Gdk
+from gi.repository import Gtk
+from pitivi.settings import ConfigError
+from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
from pitivi.utils.ui import SPACING
-from pitivi.settings import GlobalSettings, ConfigError
class BaseTabs(Gtk.Notebook, Loggable):
diff --git a/pitivi/timeline/__init__.py b/pitivi/timeline/__init__.py
index 19c30f9..52152fd 100644
--- a/pitivi/timeline/__init__.py
+++ b/pitivi/timeline/__init__.py
@@ -20,7 +20,6 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-
"""
Timeline related classes
"""
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 079dbe4..8af3925 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -20,29 +20,26 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
-
from gettext import gettext as _
-from gi.repository import GES
-from gi.repository import Gst
-from gi.repository import Gtk
+import numpy
from gi.repository import Gdk
from gi.repository import GdkPixbuf
-from gi.repository import GstController
+from gi.repository import GES
from gi.repository import GObject
+from gi.repository import Gst
+from gi.repository import GstController
+from gi.repository import Gtk
+from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas
+from matplotlib.figure import Figure
-from pitivi.utils import ui
-from pitivi.utils import misc
from pitivi import configure
from pitivi.timeline import previewers
-from pitivi.utils.loggable import Loggable
+from pitivi.utils import misc
from pitivi.utils import timeline as timelineUtils
-
-from matplotlib.figure import Figure
-from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas
-import numpy
+from pitivi.utils import ui
+from pitivi.utils.loggable import Loggable
KEYFRAME_LINE_HEIGHT = 2
KEYFRAME_LINE_ALPHA = 0.5
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 4eeeae6..b42b6d0 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -19,21 +19,19 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import re
+from gettext import gettext as _
from gi.repository import Gdk
-from gi.repository import Gtk
from gi.repository import GES
from gi.repository import Gio
from gi.repository import GObject
-
-from gettext import gettext as _
+from gi.repository import Gtk
from pitivi.timeline import elements
-from pitivi.utils.loggable import Loggable
-from pitivi.utils import ui
from pitivi.utils import timeline as timelineUtils
+from pitivi.utils import ui
+from pitivi.utils.loggable import Loggable
class TwoStateButton(Gtk.Button):
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index ca8b8cf..67bee0a 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -31,13 +31,12 @@ import sqlite3
import cairo
import numpy
-
+from gi.repository import Gdk
+from gi.repository import GdkPixbuf
from gi.repository import GES
-from gi.repository import GObject
from gi.repository import GLib
-from gi.repository import GdkPixbuf
+from gi.repository import GObject
from gi.repository import Gst
-from gi.repository import Gdk
from gi.repository import Gtk
# Our C module optimizing waveforms rendering
diff --git a/pitivi/timeline/ruler.py b/pitivi/timeline/ruler.py
index eff5740..9f692f7 100644
--- a/pitivi/timeline/ruler.py
+++ b/pitivi/timeline/ruler.py
@@ -20,21 +20,23 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-import cairo
import os
+from gettext import gettext as _
+import cairo
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import Gst
from gi.repository import Gtk
-from gettext import gettext as _
-
from pitivi import configure
from pitivi.utils.loggable import Loggable
from pitivi.utils.timeline import Zoomable
-from pitivi.utils.ui import NORMAL_FONT, PLAYHEAD_WIDTH, set_cairo_color, time_to_string, beautify_length
+from pitivi.utils.ui import beautify_length
+from pitivi.utils.ui import NORMAL_FONT
+from pitivi.utils.ui import PLAYHEAD_WIDTH
+from pitivi.utils.ui import set_cairo_color
+from pitivi.utils.ui import time_to_string
# Tuples of:
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 877fdc3..e9cd61e 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -19,34 +19,46 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
-
from gettext import gettext as _
+from gi.repository import Gdk
from gi.repository import GES
from gi.repository import Gio
from gi.repository import GLib
-from gi.repository import Gdk
from gi.repository import Gst
from gi.repository import Gtk
-from pitivi.autoaligner import AlignmentProgressDialog, AutoAligner
+from pitivi.autoaligner import AlignmentProgressDialog
+from pitivi.autoaligner import AutoAligner
from pitivi.configure import get_ui_dir
from pitivi.dialogs.prefs import PreferencesDialog
from pitivi.settings import GlobalSettings
-from pitivi.timeline.elements import Clip, TransitionClip, TrimHandle
-from pitivi.timeline.layer import Layer, LayerControls
+from pitivi.timeline.elements import Clip
+from pitivi.timeline.elements import TransitionClip
+from pitivi.timeline.elements import TrimHandle
+from pitivi.timeline.layer import Layer
+from pitivi.timeline.layer import LayerControls
from pitivi.timeline.ruler import ScaleRuler
from pitivi.utils.loggable import Loggable
-from pitivi.utils.timeline import EditingContext, Selection, \
- TimelineError, Zoomable, \
- SELECT, SELECT_ADD
-from pitivi.utils.ui import alter_style_class, clear_styles, \
- set_children_state_recurse, unset_children_state_recurse, \
- EXPANDED_SIZE, SPACING, CONTROL_WIDTH, \
- PLAYHEAD_WIDTH, LAYER_HEIGHT, SNAPBAR_WIDTH, \
- EFFECT_TARGET_ENTRY, URI_TARGET_ENTRY
+from pitivi.utils.timeline import EditingContext
+from pitivi.utils.timeline import SELECT
+from pitivi.utils.timeline import SELECT_ADD
+from pitivi.utils.timeline import Selection
+from pitivi.utils.timeline import TimelineError
+from pitivi.utils.timeline import Zoomable
+from pitivi.utils.ui import alter_style_class
+from pitivi.utils.ui import clear_styles
+from pitivi.utils.ui import CONTROL_WIDTH
+from pitivi.utils.ui import EFFECT_TARGET_ENTRY
+from pitivi.utils.ui import EXPANDED_SIZE
+from pitivi.utils.ui import LAYER_HEIGHT
+from pitivi.utils.ui import PLAYHEAD_WIDTH
+from pitivi.utils.ui import set_children_state_recurse
+from pitivi.utils.ui import SNAPBAR_WIDTH
+from pitivi.utils.ui import SPACING
+from pitivi.utils.ui import unset_children_state_recurse
+from pitivi.utils.ui import URI_TARGET_ENTRY
from pitivi.utils.widgets import ZoomBox
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index 1b22036..8ffcf08 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -18,20 +18,19 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
+from gettext import gettext as _
-from gi.repository import Gtk
-from gi.repository import Pango
from gi.repository import GES
from gi.repository import Gst
-
-from gettext import gettext as _
+from gi.repository import Gtk
+from gi.repository import Pango
from pitivi.configure import get_ui_dir
from pitivi.utils.loggable import Loggable
from pitivi.utils.timeline import SELECT
-from pitivi.utils.ui import argb_to_gdk_rgba, gdk_rgba_to_argb
+from pitivi.utils.ui import argb_to_gdk_rgba
+from pitivi.utils.ui import gdk_rgba_to_argb
FOREGROUND_DEFAULT_COLOR = 0xFFFFFFFF # White
diff --git a/pitivi/transitions.py b/pitivi/transitions.py
index 7fd56ad..79f0920 100644
--- a/pitivi/transitions.py
+++ b/pitivi/transitions.py
@@ -19,19 +19,18 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
+from gettext import gettext as _
+from gi.repository import GdkPixbuf
from gi.repository import GES
from gi.repository import GLib
from gi.repository import Gtk
-from gi.repository import GdkPixbuf
-
-from gettext import gettext as _
from pitivi.configure import get_pixmap_dir
from pitivi.utils.loggable import Loggable
-from pitivi.utils.ui import PADDING, SPACING
+from pitivi.utils.ui import PADDING
+from pitivi.utils.ui import SPACING
(COL_TRANSITION_ASSET,
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index 5d13804..b8083a0 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -18,15 +18,15 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-from gi.repository import Gst
from gi.repository import GES
from gi.repository import GObject
+from gi.repository import Gst
-from pitivi.utils.loggable import Loggable
-from pitivi.undo.undo import PropertyChangeTracker, UndoableAction,\
- FinalizingAction
from pitivi.effects import PROPS_TO_IGNORE
+from pitivi.undo.undo import FinalizingAction
+from pitivi.undo.undo import PropertyChangeTracker
+from pitivi.undo.undo import UndoableAction
+from pitivi.utils.loggable import Loggable
class CommitTimelineFinalizingAction(FinalizingAction):
diff --git a/pitivi/undo/undo.py b/pitivi/undo/undo.py
index ace492d..824073b 100644
--- a/pitivi/undo/undo.py
+++ b/pitivi/undo/undo.py
@@ -18,11 +18,9 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
Base classes for undo/redo.
"""
-
import weakref
from gi.repository import GObject
diff --git a/pitivi/utils/extract.py b/pitivi/utils/extract.py
index 458b44e..a25e558 100644
--- a/pitivi/utils/extract.py
+++ b/pitivi/utils/extract.py
@@ -19,20 +19,19 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.from gi.repository import Gst
-
"""
Classes for extracting decoded contents of streams into Python
Code derived from ui/previewer.py.
"""
-
# FIXME reimplement after GES port
+from collections import deque
from gi.repository import Gst
-from collections import deque
+
+from pitivi.utils.loggable import Loggable
# from pitivi.elements.singledecodebin import SingleDecodeBin
# from pitivi.elements.extractionsink import ExtractionSink
-from pitivi.utils.loggable import Loggable
def linkDynamic(element, target):
diff --git a/pitivi/utils/loggable.py b/pitivi/utils/loggable.py
index 03d7546..3a4d57f 100644
--- a/pitivi/utils/loggable.py
+++ b/pitivi/utils/loggable.py
@@ -18,17 +18,16 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import collections
import errno
-import sys
-import re
-import os
import fnmatch
+import os
+import re
+import sys
import threading
import time
-import types
import traceback
+import types
# environment variables controlling levels for each category
diff --git a/pitivi/utils/misc.py b/pitivi/utils/misc.py
index 9d33faf..e637285 100644
--- a/pitivi/utils/misc.py
+++ b/pitivi/utils/misc.py
@@ -19,24 +19,26 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import bisect
import hashlib
import os
import threading
import time
-from urllib.parse import urlparse, unquote, urlsplit
+from gettext import gettext as _
+from urllib.parse import unquote
+from urllib.parse import urlparse
+from urllib.parse import urlsplit
+from gi.repository import GES
from gi.repository import GLib
from gi.repository import Gst
-from gi.repository import GES
from gi.repository import Gtk
-from gettext import gettext as _
-
import pitivi.utils.loggable as log
+from pitivi.configure import APPMANUALURL_OFFLINE
+from pitivi.configure import APPMANUALURL_ONLINE
+from pitivi.configure import APPNAME
from pitivi.utils.threads import Thread
-from pitivi.configure import APPMANUALURL_OFFLINE, APPMANUALURL_ONLINE, APPNAME
# Work around https://bugzilla.gnome.org/show_bug.cgi?id=759249
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index ca1a040..285428f 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -20,21 +20,19 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-
"""
High-level pipelines
"""
-
import os
+from gi.repository import GES
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gst
-from gi.repository import GES
+from pitivi.check import videosink_factory
from pitivi.utils.loggable import Loggable
from pitivi.utils.misc import format_ns
-from pitivi.check import videosink_factory
PIPELINE_SIGNALS = {
diff --git a/pitivi/utils/proxy.py b/pitivi/utils/proxy.py
index 06e02ac..9b51cde 100644
--- a/pitivi/utils/proxy.py
+++ b/pitivi/utils/proxy.py
@@ -18,14 +18,13 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import time
-from gi.repository import GObject
from gi.repository import GES
-from gi.repository import GLib
from gi.repository import Gio
+from gi.repository import GLib
+from gi.repository import GObject
from gi.repository import Gst
from gi.repository import GstPbutils
from gi.repository import GstTranscoder
diff --git a/pitivi/utils/system.py b/pitivi/utils/system.py
index ee07fae..e7eb8b6 100644
--- a/pitivi/utils/system.py
+++ b/pitivi/utils/system.py
@@ -16,8 +16,6 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
-
-
import datetime
import multiprocessing
import os
diff --git a/pitivi/utils/threads.py b/pitivi/utils/threads.py
index 3519b68..69df09f 100644
--- a/pitivi/utils/threads.py
+++ b/pitivi/utils/threads.py
@@ -18,7 +18,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import threading
from gi.repository import GObject
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index fb43443..4db9e9a 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -19,14 +19,13 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from gi.repository import GES
from gi.repository import GObject
from gi.repository import Gst
from gi.repository import Gtk
-from pitivi.utils.loggable import Loggable
from pitivi.utils import ui
+from pitivi.utils.loggable import Loggable
# Selection modes
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index 02fac47..6ee2455 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -20,34 +20,36 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
UI constants and various functions and classes that help with UI drawing.
"""
-
-
-import cairo
import decimal
import os
-import urllib.request
-import urllib.parse
import urllib.error
+import urllib.parse
+import urllib.request
+from gettext import gettext as _
+from gettext import ngettext
-from gettext import ngettext, gettext as _
-
+import cairo
+from gi.repository import Gdk
from gi.repository import GES
+from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
-from gi.repository import Gdk
-from gi.repository import Gio
from gi.repository import Gst
from gi.repository import Gtk
-from gi.repository.GstPbutils import DiscovererVideoInfo, DiscovererAudioInfo,\
- DiscovererStreamInfo, DiscovererSubtitleInfo, DiscovererInfo
+from gi.repository.GstPbutils import DiscovererAudioInfo
+from gi.repository.GstPbutils import DiscovererInfo
+from gi.repository.GstPbutils import DiscovererStreamInfo
+from gi.repository.GstPbutils import DiscovererSubtitleInfo
+from gi.repository.GstPbutils import DiscovererVideoInfo
-from pitivi.utils.loggable import doLog, ERROR
-from pitivi.utils.misc import path_from_uri, get_proxy_target
from pitivi.configure import get_pixmap_dir
+from pitivi.utils.loggable import doLog
+from pitivi.utils.loggable import ERROR
+from pitivi.utils.misc import get_proxy_target
+from pitivi.utils.misc import path_from_uri
# Dimensions in pixels
diff --git a/pitivi/utils/validate.py b/pitivi/utils/validate.py
index 83533a3..83a5464 100644
--- a/pitivi/utils/validate.py
+++ b/pitivi/utils/validate.py
@@ -22,14 +22,14 @@ import locale
import subprocess
import gi
-from gi.repository import Gtk
-from gi.repository import Gst
-from gi.repository import GES
from gi.repository import Gdk
+from gi.repository import GES
from gi.repository import GLib
+from gi.repository import Gst
+from gi.repository import Gtk
-from pitivi.utils import ui
from pitivi.utils import timeline as timelineUtils
+from pitivi.utils import ui
CAT = "validate"
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 70b11a7..743236d 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -19,34 +19,36 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
A collection of helper classes and routines for:
* dynamically creating user interfaces
* Creating UI from GstElement-s
"""
-
import math
import os
import re
+from gettext import gettext as _
-from gi.repository import Gtk
from gi.repository import Gdk
+from gi.repository import GES
+from gi.repository import GLib
+from gi.repository import GObject
from gi.repository import Gst
from gi.repository import GstController
-from gi.repository import GES
+from gi.repository import Gtk
from gi.repository import Pango
-from gi.repository import GObject
-from gi.repository import GLib
-from gettext import gettext as _
-
-from pitivi.utils.loggable import Loggable
from pitivi.configure import get_ui_dir
-from pitivi.utils.ui import beautify_length, disable_scroll, \
- unpack_color, pack_color_32, pack_color_64, \
- time_to_string, SPACING, CONTROL_WIDTH
+from pitivi.utils.loggable import Loggable
from pitivi.utils.timeline import Zoomable
+from pitivi.utils.ui import beautify_length
+from pitivi.utils.ui import CONTROL_WIDTH
+from pitivi.utils.ui import disable_scroll
+from pitivi.utils.ui import pack_color_32
+from pitivi.utils.ui import pack_color_64
+from pitivi.utils.ui import SPACING
+from pitivi.utils.ui import time_to_string
+from pitivi.utils.ui import unpack_color
ZOOM_SLIDER_PADDING = SPACING * 4 / 5
diff --git a/pitivi/viewer/move_scale_overlay.py b/pitivi/viewer/move_scale_overlay.py
index 2c9fac4..faf7c0d 100644
--- a/pitivi/viewer/move_scale_overlay.py
+++ b/pitivi/viewer/move_scale_overlay.py
@@ -19,12 +19,11 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-import cairo
-import numpy
from collections import OrderedDict
from math import pi
+import cairo
+import numpy
from gi.repository import Gdk
from pitivi.undo.timeline import CommitTimelineFinalizingAction
diff --git a/pitivi/viewer/overlay.py b/pitivi/viewer/overlay.py
index 15302e0..e481677 100644
--- a/pitivi/viewer/overlay.py
+++ b/pitivi/viewer/overlay.py
@@ -22,9 +22,7 @@
"""
Base class for the video viewer overlays
"""
-
import numpy
-
from gi.repository import GES
from gi.repository import Gtk
diff --git a/pitivi/viewer/overlay_stack.py b/pitivi/viewer/overlay_stack.py
index f2db4f8..2bac258 100644
--- a/pitivi/viewer/overlay_stack.py
+++ b/pitivi/viewer/overlay_stack.py
@@ -19,11 +19,9 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import numpy
-
-from gi.repository import GES
from gi.repository import Gdk
+from gi.repository import GES
from gi.repository import Gtk
from pitivi.viewer.move_scale_overlay import MoveScaleOverlay
diff --git a/pitivi/viewer/title_overlay.py b/pitivi/viewer/title_overlay.py
index 995cc61..adb069f 100644
--- a/pitivi/viewer/title_overlay.py
+++ b/pitivi/viewer/title_overlay.py
@@ -19,7 +19,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import cairo
import numpy
diff --git a/pitivi/viewer/viewer.py b/pitivi/viewer/viewer.py
index 6a26fcf..0aa1350 100644
--- a/pitivi/viewer/viewer.py
+++ b/pitivi/viewer/viewer.py
@@ -18,13 +18,12 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from gettext import gettext as _
from time import time
+from gi.repository import Gdk
from gi.repository import GES
from gi.repository import GObject
-from gi.repository import Gdk
from gi.repository import Gst
from gi.repository import Gtk
diff --git a/tests/__init__.py b/tests/__init__.py
index 5c16f03..1d6be27 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
-
from . import runtests
if not runtests.setup():
raise ImportError("Could not setup testsuite")
diff --git a/tests/common.py b/tests/common.py
index 00c6d9a..5e9efcb 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -1,25 +1,24 @@
"""
A collection of objects to use for testing
"""
-
-import os
import gc
+import os
import sys
import tempfile
import unittest
+from unittest import mock
from gi.repository import Gdk
from gi.repository import Gst
from gi.repository import Gtk
-from unittest import mock
from pitivi import check
-
from pitivi.application import Pitivi
from pitivi.utils.loggable import Loggable
+from pitivi.utils.proxy import ProxyingStrategy
+from pitivi.utils.proxy import ProxyManager
from pitivi.utils.timeline import Selected
from pitivi.utils.validate import Event
-from pitivi.utils.proxy import ProxyManager, ProxyingStrategy
detect_leaks = os.environ.get("PITIVI_TEST_DETECT_LEAKS", "0") not in ("0", "")
os.environ["PITIVI_USER_CACHE_DIR"] = tempfile.mkdtemp("pitiviTestsuite")
diff --git a/tests/runtests.py b/tests/runtests.py
index 4883fce..68b9e89 100644
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -1,7 +1,5 @@
#!/usr/bin/env python3
-
"""Pitivi tests runner."""
-
import os
import sys
import unittest
diff --git a/tests/test_application.py b/tests/test_application.py
index 5d7ae0d..81bb592 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -19,11 +19,9 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-from tests import common
-
from pitivi import application
from pitivi import configure
+from tests import common
class MockGioFile(object):
diff --git a/tests/test_check.py b/tests/test_check.py
index 1106dce..293bcee 100644
--- a/tests/test_check.py
+++ b/tests/test_check.py
@@ -19,10 +19,8 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-from tests import common
-
from pitivi import check
+from tests import common
class FakeDependency(check.Dependency):
diff --git a/tests/test_clipproperties.py b/tests/test_clipproperties.py
index af4c5bb..7340605 100644
--- a/tests/test_clipproperties.py
+++ b/tests/test_clipproperties.py
@@ -16,7 +16,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import unittest
from gi.repository import Gtk
diff --git a/tests/test_common.py b/tests/test_common.py
index 9b47d4a..0c6a730 100644
--- a/tests/test_common.py
+++ b/tests/test_common.py
@@ -18,10 +18,8 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-from tests import common
-
import pitivi.utils.ui as ui_common
+from tests import common
class TestColors(common.TestCase):
diff --git a/tests/test_log.py b/tests/test_log.py
index 4e6975d..c455131 100644
--- a/tests/test_log.py
+++ b/tests/test_log.py
@@ -4,22 +4,17 @@
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
-
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Foundation.
# This file is distributed without any warranty; without even the implied
# warranty of merchantability or fitness for a particular purpose.
# See "LICENSE.GPL" in the source distribution for more information.
-
# Licensees having purchased or holding a valid Flumotion Advanced
# Streaming Server license may use this file in accordance with the
# Flumotion Advanced Streaming Server Commercial License Agreement.
# See "LICENSE.Flumotion" in the source distribution for more information.
-
# Headers in this file shall remain intact.
-
-
import unittest
from pitivi.utils import loggable as log
diff --git a/tests/test_mainwindow.py b/tests/test_mainwindow.py
index a5bd286..030bf1b 100644
--- a/tests/test_mainwindow.py
+++ b/tests/test_mainwindow.py
@@ -16,13 +16,10 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
Test for pitivi/mainwindow.py
"""
-
import os
-
from unittest import mock
from gi.repository import GES
@@ -32,7 +29,6 @@ from gi.repository import Gtk
from pitivi.mainwindow import PitiviMainWindow
from pitivi.project import ProjectManager
from pitivi.utils.misc import disconnectAllByFunc
-
from tests import common
diff --git a/tests/test_media_library.py b/tests/test_media_library.py
index 0be7e2e..16d50c2 100644
--- a/tests/test_media_library.py
+++ b/tests/test_media_library.py
@@ -16,22 +16,19 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import tempfile
-
-from unittest import mock
from gettext import gettext as _
+from unittest import mock
from gi.repository import GES
-from gi.repository import Gst
from gi.repository import GLib
+from gi.repository import Gst
from pitivi import medialibrary
from pitivi.project import ProjectManager
from pitivi.timeline import timeline
from pitivi.utils.proxy import ProxyingStrategy
-
from tests import common
diff --git a/tests/test_misc.py b/tests/test_misc.py
index e35132e..11ef580 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -16,7 +16,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import unittest
from pitivi.utils.misc import binary_search
diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py
index faee19f..e9090c1 100644
--- a/tests/test_pipeline.py
+++ b/tests/test_pipeline.py
@@ -16,15 +16,13 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import mock
from gi.repository import GLib
from gi.repository import Gst
-from tests import common
-
from pitivi.utils import pipeline
+from tests import common
class MockedPipeline(pipeline.Pipeline):
diff --git a/tests/test_prefs.py b/tests/test_prefs.py
index d0bde95..1e44146 100644
--- a/tests/test_prefs.py
+++ b/tests/test_prefs.py
@@ -16,7 +16,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import unittest
from pitivi.dialogs.prefs import PreferencesDialog
diff --git a/tests/test_preset.py b/tests/test_preset.py
index 2e78766..dd20684 100644
--- a/tests/test_preset.py
+++ b/tests/test_preset.py
@@ -20,16 +20,14 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
# TODO: add a specific testcase for audio, video, render presets
-
import os.path
import shutil
import tempfile
from unittest import TestCase
-from pitivi.preset import PresetManager, \
- AudioPresetManager
+from pitivi.preset import AudioPresetManager
+from pitivi.preset import PresetManager
class FakePresetManager(PresetManager):
diff --git a/tests/test_previewers.py b/tests/test_previewers.py
index 7fad643..a2cb51a 100644
--- a/tests/test_previewers.py
+++ b/tests/test_previewers.py
@@ -16,21 +16,19 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import pickle
-
from unittest import mock
from gi.repository import GES
from gi.repository import Gst
+from pitivi.timeline.previewers import get_wavefile_location_for_uri
+from pitivi.timeline.previewers import getThumbnailCache
+from pitivi.timeline.previewers import THUMB_HEIGHT
from tests import common
from tests.test_media_library import TestMediaLibrary
-from pitivi.timeline.previewers import getThumbnailCache, THUMB_HEIGHT, \
- get_wavefile_location_for_uri
-
class TestPreviewers(common.TestCase):
def testCreateThumbnailBin(self):
diff --git a/tests/test_project.py b/tests/test_project.py
index d447ab7..1fa2aff 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -17,21 +17,21 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import tempfile
import time
+from unittest import mock
+from unittest import TestCase
-from unittest import TestCase, mock
from gi.repository import GES
from gi.repository import GLib
from gi.repository import Gst
from pitivi.application import Pitivi
-from pitivi.project import ProjectManager, Project
+from pitivi.project import Project
+from pitivi.project import ProjectManager
from pitivi.utils.misc import uri_is_reachable
from pitivi.utils.proxy import ProxyingStrategy
-
from tests import common
diff --git a/tests/test_system.py b/tests/test_system.py
index 44c775d..885792e 100644
--- a/tests/test_system.py
+++ b/tests/test_system.py
@@ -19,12 +19,15 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import TestCase
-from pitivi.utils.system import System, getSystem, GnomeSystem, \
- INHIBIT_LOGOUT, INHIBIT_SUSPEND, INHIBIT_SESSION_IDLE, \
- INHIBIT_USER_SWITCHING
+from pitivi.utils.system import getSystem
+from pitivi.utils.system import GnomeSystem
+from pitivi.utils.system import INHIBIT_LOGOUT
+from pitivi.utils.system import INHIBIT_SESSION_IDLE
+from pitivi.utils.system import INHIBIT_SUSPEND
+from pitivi.utils.system import INHIBIT_USER_SWITCHING
+from pitivi.utils.system import System
class TestSystem(TestCase):
diff --git a/tests/test_timeline_layer.py b/tests/test_timeline_layer.py
index ebca9f5..30be362 100644
--- a/tests/test_timeline_layer.py
+++ b/tests/test_timeline_layer.py
@@ -16,15 +16,13 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import mock
from gi.repository import GES
-from tests import common
-
from pitivi.timeline.layer import Layer
from pitivi.timeline.timeline import Timeline
+from tests import common
class TestLayerControl(common.TestCase):
diff --git a/tests/test_timeline_timeline.py b/tests/test_timeline_timeline.py
index e0ff83d..57a4025 100644
--- a/tests/test_timeline_timeline.py
+++ b/tests/test_timeline_timeline.py
@@ -16,18 +16,17 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import mock
+
from gi.repository import Gdk
from gi.repository import GES
from gi.repository import Gtk
-from tests import common
-
from pitivi.project import ProjectManager
from pitivi.timeline.timeline import TimelineContainer
-from pitivi.utils.validate import Event
from pitivi.utils import ui
+from pitivi.utils.validate import Event
+from tests import common
SEPARATOR_HEIGHT = 4
diff --git a/tests/test_undo.py b/tests/test_undo.py
index f52ab22..8b40234 100644
--- a/tests/test_undo.py
+++ b/tests/test_undo.py
@@ -18,11 +18,13 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import TestCase
-from pitivi.undo.undo import UndoError, UndoWrongStateError, UndoableAction, \
- UndoableActionStack, UndoableActionLog
+from pitivi.undo.undo import UndoableAction
+from pitivi.undo.undo import UndoableActionLog
+from pitivi.undo.undo import UndoableActionStack
+from pitivi.undo.undo import UndoError
+from pitivi.undo.undo import UndoWrongStateError
class DummyUndoableAction(UndoableAction):
diff --git a/tests/test_undo_timeline.py b/tests/test_undo_timeline.py
index 6358462..832773d 100644
--- a/tests/test_undo_timeline.py
+++ b/tests/test_undo_timeline.py
@@ -19,19 +19,19 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import TestCase
from gi.repository import GES
from gi.repository import Gst
-from tests import common
-
-from pitivi.undo.timeline import TimelineLogObserver, \
- ClipAdded, ClipRemoved, \
- ClipPropertyChanged, TrackElementAdded
-from pitivi.undo.undo import UndoableActionLog
from pitivi.application import Pitivi
+from pitivi.undo.timeline import ClipAdded
+from pitivi.undo.timeline import ClipPropertyChanged
+from pitivi.undo.timeline import ClipRemoved
+from pitivi.undo.timeline import TimelineLogObserver
+from pitivi.undo.timeline import TrackElementAdded
+from pitivi.undo.undo import UndoableActionLog
+from tests import common
class TimelineLogObserverSpy(TimelineLogObserver):
diff --git a/tests/test_utils.py b/tests/test_utils.py
index ff99135..0cc0384 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -20,12 +20,12 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import TestCase
from gi.repository import Gst
-from pitivi.utils.ui import beautify_length
+
from pitivi.check import * # noqa
+from pitivi.utils.ui import beautify_length
second = Gst.SECOND
minute = second * 60
diff --git a/tests/test_utils_timeline.py b/tests/test_utils_timeline.py
index b82e699..1f2f205 100644
--- a/tests/test_utils_timeline.py
+++ b/tests/test_utils_timeline.py
@@ -16,16 +16,18 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
-from unittest import TestCase, mock
+from unittest import mock
+from unittest import TestCase
from gi.repository import GES
+from pitivi.utils.timeline import SELECT
+from pitivi.utils.timeline import SELECT_ADD
+from pitivi.utils.timeline import Selected
+from pitivi.utils.timeline import Selection
+from pitivi.utils.timeline import UNSELECT
from tests import common
-from pitivi.utils.timeline import Selected, Selection, SELECT, SELECT_ADD, \
- UNSELECT
-
class TestSelected(TestCase):
diff --git a/tests/test_widgets.py b/tests/test_widgets.py
index 3e36c8b..e608f65 100644
--- a/tests/test_widgets.py
+++ b/tests/test_widgets.py
@@ -16,10 +16,15 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
from unittest import TestCase
-from pitivi.utils.widgets import PathWidget, TextWidget, NumericWidget, ToggleWidget, ChoiceWidget,
ColorWidget, FontWidget
+from pitivi.utils.widgets import ChoiceWidget
+from pitivi.utils.widgets import ColorWidget
+from pitivi.utils.widgets import FontWidget
+from pitivi.utils.widgets import NumericWidget
+from pitivi.utils.widgets import PathWidget
+from pitivi.utils.widgets import TextWidget
+from pitivi.utils.widgets import ToggleWidget
class TestWidgets(TestCase):
diff --git a/tests/validate-tests/pitivi.py b/tests/validate-tests/pitivi.py
index fd319b5..2609a1a 100644
--- a/tests/validate-tests/pitivi.py
+++ b/tests/validate-tests/pitivi.py
@@ -16,7 +16,6 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
"""
The GES GstValidate default testsuite
"""
diff --git a/tests/validate-tests/pitivivalidate.py b/tests/validate-tests/pitivivalidate.py
index 9c75919..8e22e31 100644
--- a/tests/validate-tests/pitivivalidate.py
+++ b/tests/validate-tests/pitivivalidate.py
@@ -16,13 +16,15 @@
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301, USA.
-
import os
import sys
+from urllib import unquote
+
import urlparse
import utils
-from urllib import unquote
-from baseclasses import GstValidateTest, TestsManager, ScenarioManager
+from baseclasses import GstValidateTest
+from baseclasses import ScenarioManager
+from baseclasses import TestsManager
Pitivi_DURATION_TOLERANCE = utils.GST_SECOND / 2
diff --git a/win32/configure.py b/win32/configure.py
index cd4ccc3..7ff6359 100644
--- a/win32/configure.py
+++ b/win32/configure.py
@@ -20,7 +20,6 @@
Utilities for getting the location of various directories.
Enables identical use for installed and uninstalled versions.
"""
-
import os.path
LIBDIR = os.path.realpath('../lib/pitivi')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]