Commit f1c12301 authored by Jakub Brindza's avatar Jakub Brindza Committed by Alexandru Băluț

Remove the file names from the header comment and add utf-8 spec

Also updated the ignored files list in pre-commit.hook and made some
very small fixes required by pep8 to be able to commit.

Differential Revision: https://phabricator.freedesktop.org/D1033
parent 129b638d
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......@@ -76,7 +74,7 @@ def _add_pitivi_path():
root = os.path.join(LIBDIR, 'pitivi', 'python')
localedir = os.path.join(DATADIR, "locale")
if not root in sys.path:
if root not in sys.path:
sys.path.append(root)
# prepend any directories found at configure time if they're not
......@@ -122,12 +120,14 @@ def _initialize_modules():
print("Failed to initialize modules")
raise
def _check_requirements():
from pitivi.check import check_requirements
if not check_requirements():
sys.exit(2)
def _run_pitivi():
from pitivi import application
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/application.py
#
# Copyright (c) 2005-2009 Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2008-2009 Alessandro Decina <alessandro.d@gmail.com>
# Copyright (c) 2014 Alexandru Băluț<alexandru.balut@gmail.com>
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/autoaligner.py
#
# Copyright (c) 2011, Benjamin M. Schwartz <bens@alum.mit.edu>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/check.py
#
# Copyright (c) 2014, Mathieu Duponchelle <mduponchelle1@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/clipproperties.py
#
# Copyright (C) 2010 Thibault Saunier <tsaunier@gnome.org>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/configure.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/dialogs/clipmediaprops.py
#
# Copyright (c) 2011, Parthasarathi Susarla <partha@collabora.co.uk>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/dialogs/depsmanager.py
#
# Copyright (c) 2011 Jean-François Fortin Tam <nekohayo@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/dialogs/filelisterrordialog.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/dialogs/prefs.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/dialogs/startupwizard.py
#
# Copyright (c) 2010 Mathieu Duponchelle <seeed@laposte.net>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/effects.py
#
# Copyright (c) 2010, Thibault Saunier <tsaunier@gnome.org>
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/mainwindow.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/mediafilespreviewer.py
#
# Copyright (c) 2011, Pier Carteri <pier.carteri@gmail.com>
# Copyright (c) 2012, Thibault Saunier <tsaunier@gnome.org>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/medialibrary.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2009, Alessandro Decina <alessandro.d@gmail.com>
# Copyright (c) 2012, Jean-François Fortin Tam <nekohayo@gmail.com>
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/preset.py
#
# Copyright (c) 2010, Brandon Lewis <brandon_lewis@berkeley.edu>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/project.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2013, 2014, 2015, Thibault Saunier <tsaunier@gnome.org>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/render.py
#
# Copyright (c) 2009, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/settings.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/tabsmanager.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/timeline/elements.py
#
# Copyright (c) 2013, Mathieu Duponchelle <mduponchelle1@gmail.com>
# Copyright (c) 2016, Thibault Saunier <tsaunier@gnome.org>
#
......@@ -515,7 +512,7 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
self.__removeKeyframes()
self.keyframe_curve = KeyframeCurve(self.timeline, binding)
self.keyframe_curve.connect("plot-changed",
self.__keyframePlotChangedCb)
self.__keyframePlotChangedCb)
self.keyframe_curve.connect("enter", self.__curveEnterCb)
self.keyframe_curve.connect("leave", self.__curveLeaveCb)
self.add(self.keyframe_curve)
......
# -- coding: utf-8 --
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/timeline/layer.py
#
# Copyright (c) 2012, Paul Lange <palango@gmx.de>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/timeline/previewers.py
#
# Copyright (c) 2013, Daniel Thul <daniel.thul@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/timeline/ruler.py
#
# Copyright (c) 2006, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2014, Alex Băluț <alexandru.balut@gmail.com>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/timeline/timeline.py
#
# Copyright (c) 2013, Mathieu Duponchelle <mduponchelle1@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/titleeditor.py
#
# Copyright (c) 2012, Matas Brazdeikis <matas@brazdeikis.lt>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/transitions.py
#
# Copyright (c) 2012, Jean-François Fortin Tam <nekohayo@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/undo/project.py
#
# Copyright (c) 2012, Thibault Saunier <tsaunier@gnome.org>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/undo/timeline.py
#
# Copyright (c) 2009, Alessandro Decina <alessandro.d@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/undo/undo.py
#
# Copyright (c) 2009, Alessandro Decina <alessandro.d@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/extract.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2011, Benjamin M. Schwartz <bens@alum.mit.edu>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/loggable.py
#
# Copyright (c) 2009, Alessandro Decina <alessandro.decina@collabora.co.uk>
#
# This program is free software; you can redistribute it and/or
......@@ -648,23 +646,24 @@ def logLevelName(level):
def _preformatLevels(enableColorOutput):
if enableColorOutput:
t = TerminalController()
if type(t.BOLD) == bytes:
formatter = lambda level: ''.join(
(t.BOLD.decode(), getattr(t, COLORS[level]).decode(),
logLevelName(level), t.NORMAL.decode()))
else:
formatter = lambda level: ''.join(
(t.BOLD, getattr(t, COLORS[level]),
logLevelName(level), t.NORMAL))
else:
formatter = lambda level: logLevelName(level)
terminal_controller = TerminalController()
for level in ERROR, WARN, FIXME, INFO, DEBUG, LOG:
_FORMATTED_LEVELS.append(formatter(level))
if enableColorOutput:
if type(terminal_controller.BOLD) == bytes:
formatter = ''.join(
(terminal_controller.BOLD.decode(),
getattr(terminal_controller, COLORS[level]).decode(),
logLevelName(level),
terminal_controller.NORMAL.decode()))
else:
formatter = ''.join(
(terminal_controller.BOLD,
getattr(terminal_controller, COLORS[level]),
logLevelName(level),
terminal_controller.NORMAL))
else:
formatter = logLevelName(level)
_FORMATTED_LEVELS.append(formatter)
# "public" useful API
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/misc.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2009, Alessandro Decina <alessandro.d@gmail.com>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/proxying.py
#
# Copyright (c) 2015, Thibault Saunier <tsaunier@gnome.org>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/ripple_update_group.py
#
# Copyright (c) 2010, Brandon Lewis <brandon.lewis@collabora.co.uk>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/system.py
#
# Copyright (c) 2010, Stephen Griffiths <scgmk5@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# threads.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/timeline.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2009, Alessandro Decina <alessandro.decina@collabora.co.uk>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/ui.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
# Copyright (c) 2012, Thibault Saunier <thibault.saunier@collabora.com>
#
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/validate.py
#
# Copyright (c) 2014, Thibault Saunier <thibault.saunier@collabora.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/utils/widgets.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/viewer/move_scale_overlay.py
#
# Copyright (c) 2016, Lubosz Sarnecki <lubosz.sarnecki@collabora.co.uk>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/viewer/overlay.py
#
# Copyright (c) 2016, Lubosz Sarnecki <lubosz.sarnecki@collabora.co.uk>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/viewer/overlay_stack.py
#
# Copyright (c) 2016, Lubosz Sarnecki <lubosz.sarnecki@collabora.co.uk>
#
# This program is free software; you can redistribute it and/or
......@@ -143,7 +140,7 @@ class OverlayStack(Gtk.Overlay, Loggable):
try:
cursor = Gdk.Cursor.new_from_name(display, name)
except TypeError:
self.warning ("Cursor '%s' not found.", name)
self.warning("Cursor '%s' not found.", name)
self.app.gui.get_window().set_cursor(cursor)
def reset_cursor(self):
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/viewer/title_overlay.py
#
# Copyright (c) 2016, Lubosz Sarnecki <lubosz.sarnecki@collabora.co.uk>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# pitivi/viewer/viewer.py
#
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
......
......@@ -2,73 +2,79 @@
RCFILE=$(git rev-parse --show-toplevel)/docs/pylint.rc
IGNORED_FILES=" \
tests/test_check.py \
tests/test_system.py \
tests/test_timeline_layer.py \
tests/runtests.py \
tests/test_utils_timeline.py \
tests/test_prefs.py \
mests/test_undo.py \
tests/test_utils.py \
tests/test_project.py \
tests/test_clipproperties.py \
tests/test_preset.py \
tests/test_previewers.py \
tests/test_undo_timeline.py \
tests/validate-tests/pitivi.py \
tests/validate-tests/pitivivalidate.py \
tests/test_media_library.py \
tests/test_misc.py \
tests/test_widgets.py \
tests/test_common.py \
tests/common.py \
tests/test_timeline_elements.py \
tests/test_timeline_timeline.py \
tests/test_pipeline.py \
tests/test_application.py \
tests/test_log.py \
pitivi/titleeditor.py \
pitivi/settings.py \
pitivi/project.py \
pitivi/check.py \
pitivi/medialibrary.py \
pitivi/preset.py \
pitivi/configure.py \
pitivi/utils/validate.py \
pitivi/utils/loggable.py \
pitivi/utils/widgets.py \
pitivi/utils/proxy.py \
pitivi/utils/system.py \
pitivi/utils/timeline.py \
pitivi/utils/threads.py \
pitivi/utils/pipeline.py \
pitivi/utils/extract.py \
pitivi/utils/misc.py \
pitivi/utils/ripple_update_group.py \
pitivi/utils/ui.py \
pitivi/dialogs/startupwizard.py \
pitivi/dialogs/clipmediaprops.py \
pitivi/dialogs/prefs.py \
pitivi/dialogs/depsmanager.py \
pitivi/dialogs/filelisterrordialog.py \
pitivi/transitions.py \
pitivi/application.py \
pitivi/effects.py \
pitivi/viewer/viewer.py \
pitivi/clipproperties.py \
pitivi/timeline/timeline.py \
pitivi/timeline/layer.py \
pitivi/timeline/ruler.py \
pitivi/timeline/elements.py \
pitivi/autoaligner.py \
pitivi/mainwindow.py \
pitivi/mediafilespreviewer.py \
pitivi/undo/undo.py \
pitivi/undo/timeline.py \
pitivi/render.py \
pitivi/viewer/move_scale_overlay.py \
pitivi/viewer/overlay_stack.py \
IGNORED_FILES="
bin/pitivi.in
pitivi/application.py
pitivi/autoaligner.py
pitivi/check.py
pitivi/clipproperties.py
pitivi/configure.py
pitivi/dialogs/clipmediaprops.py
pitivi/dialogs/depsmanager.py
pitivi/dialogs/filelisterrordialog.py
pitivi/dialogs/prefs.py
pitivi/dialogs/startupwizard.py
pitivi/effects.py
pitivi/mainwindow.py
pitivi/mediafilespreviewer.py
pitivi/medialibrary.py
pitivi/preset.py
pitivi/project.py
pitivi/render.py
pitivi/settings.py
pitivi/timeline/elements.py
pitivi/timeline/layer.py
pitivi/timeline/ruler.py
pitivi/timeline/timeline.py
pitivi/titleeditor.py
pitivi/transitions.py
pitivi/undo/project.py
pitivi/undo/timeline.py
pitivi/undo/undo.py
pitivi/utils/extract.py
pitivi/utils/loggable.py
pitivi/utils/misc.py
pitivi/utils/pipeline.py
pitivi/utils/proxy.py
pitivi/utils/ripple_update_group.py
pitivi/utils/system.py
pitivi/utils/threads.py
pitivi/utils/timeline.py
pitivi/utils/ui.py
pitivi/utils/validate.py
pitivi/utils/widgets.py
pitivi/viewer/move_scale_overlay.py
pitivi/viewer/overlay_stack.py
pitivi/viewer/title_overlay.py
pitivi/viewer/viewer.py
tests/common.py
tests/runtests.py
tests/test_application.py
tests/test_check.py
tests/test_clipproperties.py
tests/test_common.py
tests/test_log.py
tests/test_media_library.py
tests/test_misc.py
tests/test_pipeline.py
tests/test_prefs.py
tests/test_preset.py
tests/test_previewers.py
tests/test_project.py
tests/test_system.py
tests/test_timeline_elements.py
tests/test_timeline_layer.py
tests/test_timeline_timeline.py
tests/test_undo.py
tests/test_undo_project.py
tests/test_undo_timeline.py
tests/test_utils.py
tests/test_utils_timeline.py
tests/test_widgets.py
tests/validate-tests/pitivi.py
tests/validate-tests/pitivivalidate.py
win32/configure.py
win32/pitivi
"
git-pylint-commit-hook --help |grep ignore > /dev/null 2>&1
......@@ -81,7 +87,8 @@ elif [ -z $PYLINT ]; then
for f in $IGNORED_FILES; do
IGNORE_ARGS="$IGNORE_ARGS --ignore=$f"
done
echo "Pylint ignoring files:$IGNORED_FILES"
echo "Pylint ignoring files:$IGNORED_FILES" | tr "\n" " "
echo
fi
export PYTHONPATH=$(git rev-parse --show-toplevel)/pitivi/coptimizations/.libs:$PYTHONPATH
......
# -*- coding: utf-8 -*-
#
# Pitivi video editor
# Copyright (c) 2015, Thibault Saunier <tsaunier@gnome.org>
#
# This program is free software; you can redistribute it and/or
......@@ -196,6 +196,7 @@ class TestCase(unittest.TestCase, Loggable):
expect_selected)
self.assertEqual(ges_clip.selected.selected, expect_selected)
@contextlib.contextmanager
def created_project_file(asset_uri="file:///icantpossiblyexist.png"):
"""
......@@ -243,6 +244,7 @@ def clean_proxy_samples():
f = os.path.join(_dir, f)
os.remove(f)
def create_test_clip(clip_type):
clip = clip_type()
clip.selected = Selected()
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# tests/test_application.py
#
# Copyright (c) 2014, Alex Băluț <alexandru.balut@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# tests/test_check.py
#
# Copyright (c) 2014, Alex Băluț <alexandru.balut@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
#
# Pitivi video editor
# Copyright (c) 2014, Alex Băluț <alexandru.balut@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
# Pitivi video editor
#
# tests/test_common.py
#
# Copyright (c) 2011 Google <aleb@google.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
#
# Pitivi video editor
# Copyright (c) 2013, Alex Băluț <alexandru.balut@gmail.com>
#
# This program is free software; you can redistribute it and/or
......
# -*- coding: utf-8 -*-
#
# Pitivi video editor