[pitivi] Fix pydocstyle errors



commit 33a4176b1afdf7bc1b5aad6d9b171117f52bf824
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat Dec 28 23:53:57 2019 +0100

    Fix pydocstyle errors

 pitivi/dialogs/filelisterrordialog.py |  1 +
 pitivi/editorperspective.py           |  5 +----
 pitivi/medialibrary.py                | 11 +++--------
 pitivi/preset.py                      |  9 ++++++---
 pitivi/settings.py                    |  5 ++++-
 pitivi/utils/pipeline.py              |  3 ++-
 pitivi/utils/proxy.py                 |  4 ++++
 pitivi/utils/system.py                |  6 +++---
 pitivi/utils/widgets.py               |  3 ++-
 plugins/console/widgets.py            |  2 +-
 10 files changed, 27 insertions(+), 22 deletions(-)
---
diff --git a/pitivi/dialogs/filelisterrordialog.py b/pitivi/dialogs/filelisterrordialog.py
index ee1f90c5..798fbd24 100644
--- a/pitivi/dialogs/filelisterrordialog.py
+++ b/pitivi/dialogs/filelisterrordialog.py
@@ -57,6 +57,7 @@ class FileListErrorDialog(GObject.Object, Loggable):
         Args:
             uri (str): The URI of the asset which cannot be imported.
             reason (Optional[str]): The reason of the file discovery failure.
+            extra (Optional[str]): Extra information to display.
         """
         self.debug("Uri: %s, reason: %s, extra: %s", uri, reason, extra)
         exp = self.__create_file_expander(uri, reason, extra)
diff --git a/pitivi/editorperspective.py b/pitivi/editorperspective.py
index f48a2fe9..859a85a3 100644
--- a/pitivi/editorperspective.py
+++ b/pitivi/editorperspective.py
@@ -567,16 +567,13 @@ class EditorPerspective(Perspective, Loggable):
 
         return res
 
-    def _project_manager_project_closed_cb(self, unused_project_manager, project):
+    def _project_manager_project_closed_cb(self, project_manager, project):
         """Starts disconnecting the UI from the specified project.
 
         This happens when the user closes the app or asks to load another
         project, immediately after the user confirmed that unsaved changes,
         if any, can be discarded but before the filechooser to pick the next
         project to load appears.
-
-        Args:
-            project (Project): The project which has been closed.
         """
         # We must disconnect from the project pipeline before it is released:
         if project.pipeline is not None:
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 15b5d6df..4cd082d9 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -535,7 +535,7 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         # Store
         self.storemodel = Gtk.ListStore(*STORE_MODEL_STRUCTURE)
         self.storemodel.set_sort_func(
-            COL_URI, MediaLibraryWidget.compare_basename)
+            COL_URI, MediaLibraryWidget.compare_basename_func)
         # Prefer to sort the media library elements by URI
         # rather than show them randomly.
         self.storemodel.set_sort_column_id(COL_URI, Gtk.SortType.ASCENDING)
@@ -710,13 +710,8 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         self.__disconnect_from_project()
 
     @staticmethod
-    def compare_basename(model, iter1, iter2, unused_user_data):
-        """Compares two model elements.
-
-        Args:
-            iter1 (Gtk.TreeIter): The iter identifying the first model element.
-            iter2 (Gtk.TreeIter): The iter identifying the second model element.
-        """
+    def compare_basename_func(model, iter1, iter2, user_data):
+        """Compares two model elements."""
         uri1 = model[iter1][COL_URI]
         uri2 = model[iter2][COL_URI]
         basename1 = GLib.path_get_basename(uri1).lower()
diff --git a/pitivi/preset.py b/pitivi/preset.py
index 8947abbd..93dd0b63 100644
--- a/pitivi/preset.py
+++ b/pitivi/preset.py
@@ -534,7 +534,7 @@ class EncodingTargetManager(PresetManager):
                 self._add_target(target)
 
     def create_preset(self, name, values=None):
-        self.save_current_preset(name, validate_name=False)
+        self._save_current_preset_as_target(name)
 
     def get_new_preset_name(self):
         """Gets a unique name for a new preset."""
@@ -547,7 +547,7 @@ class EncodingTargetManager(PresetManager):
             i += 1
         return name
 
-    def save_current_preset(self, new_name, validate_name=True):
+    def save_current_preset(self, new_name=None):
         """Saves currently selected profile on disk.
 
         Override from PresetManager
@@ -555,10 +555,13 @@ class EncodingTargetManager(PresetManager):
         Args:
             new_name (str): The name to save current Gst.EncodingProfile as.
         """
-        if validate_name and not self.combo.get_parent().valid:
+        if not self.combo.get_parent().valid:
             self.error("Current encoding target name is not valid")
             return
 
+        self._save_current_preset_as_target(new_name)
+
+    def _save_current_preset_as_target(self, new_name):
         if new_name in self._removed_profiles:
             self._removed_profiles.remove(new_name)
             self._save_removed_profiles()
diff --git a/pitivi/settings.py b/pitivi/settings.py
index dc559648..03bfb1a0 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -304,7 +304,7 @@ class GlobalSettings(GObject.Object, Loggable):
 
     @classmethod
     def add_config_option(cls, attrname, type_=None, section=None, key=None,
-                          environment=None, default=None, notify=False,):
+                          environment=None, default=None, notify=False):
         """Adds a configuration option.
 
         This function should be called during module initialization, before
@@ -324,6 +324,9 @@ class GlobalSettings(GObject.Object, Loggable):
                 add_config_section(). Not necessary if `key` is not given.
             key (Optional[str]): The key under which this option is to be saved.
                 By default the option will not be saved.
+            environment (Optional[str]): The name of the environment variable
+                for overwriting the value of the option.
+            default (Optional[object]): The default value of the option.
             notify (Optional[bool]): Whether this attribute should emit
                 signals when modified. By default signals are not emitted.
         """
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index 2842d4b9..a96fb5e1 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -585,7 +585,8 @@ class Pipeline(GES.Pipeline, SimplePipeline):
         This clamps the playhead to the project frames.
 
         Args:
-            frames_offsets (int): The number of frames to step. Negative number
+            framerate (Gst.Fraction): The framerate of the project.
+            frames_offset (int): The number of frames to step. Negative number
                 for stepping backwards.
         """
         try:
diff --git a/pitivi/utils/proxy.py b/pitivi/utils/proxy.py
index a2f92448..7dfa8ec8 100644
--- a/pitivi/utils/proxy.py
+++ b/pitivi/utils/proxy.py
@@ -687,6 +687,10 @@ class ProxyManager(GObject.Object, Loggable):
 
         Args:
             asset (GES.Asset): The asset to be transcoded.
+            scaled (Optional[bool]): Whether to create a scaled proxy instead
+                of a high-quality proxy.
+            shadow (Optional[bool]): Whether to create a high-quality proxy
+                to shadow a scaled proxy.
         """
         force_proxying = asset.force_proxying
         # Handle Automatic scaling
diff --git a/pitivi/utils/system.py b/pitivi/utils/system.py
index aa72140b..e6f6f11b 100644
--- a/pitivi/utils/system.py
+++ b/pitivi/utils/system.py
@@ -47,7 +47,7 @@ class System(GObject.Object, Loggable):
     def has_x11(self):
         return self._x11
 
-    def desktop_message(self, title, message, unused_icon=None):
+    def desktop_message(self, title, message, icon=None):
         """Sends a message to the desktop to be displayed to the user.
 
         Args:
@@ -55,7 +55,7 @@ class System(GObject.Object, Loggable):
             message (str): The body of the message.
             icon (str): The icon to be shown with the message
         """
-        self.debug("desktop_message(): %s, %s", title, message)
+        self.debug("%s, %s, %s", title, message, icon)
 
     def get_unique_filename(self, string):
         """Gets a filename which can only be obtained from the specified string.
@@ -92,7 +92,7 @@ class FreedesktopOrgSystem(System):
                 # See for example
                 # https://bugzilla.gnome.org/show_bug.cgi?id=719627.
                 self.error(
-                    "desktop_message: Failed displaying notification: %s", e.message)
+                    "Failed displaying notification: %s", e.message)
                 return None
             return notification
         return None
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 4e29432d..88349b28 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -817,11 +817,12 @@ class GstElementSettingsWidget(Gtk.Box, Loggable):
         If there are no properties, returns a "No properties" label.
 
         Args:
-            create_property_widget (function): The function that gets the widget for an effect property.
+            create_property_widget (function): The function that creates the widget for an effect property.
             values (dict): The current values of the element props, by name.
                 If empty, the default values will be used.
             with_reset_button (bool): Whether to show a reset button for each
                 property.
+            caps_values (Optional[dict]): Map of caps fields to their values.
         """
         values = values or {}
         self.info("element: %s, use values: %s", self.element, values)
diff --git a/plugins/console/widgets.py b/plugins/console/widgets.py
index a5450b8c..4ab93835 100644
--- a/plugins/console/widgets.py
+++ b/plugins/console/widgets.py
@@ -96,7 +96,7 @@ class ConsoleWidget(Gtk.ScrolledWindow):
         """Sets the font.
 
         Args:
-            font (str): a PangoFontDescription as a string.
+            font_desc (str): a PangoFontDescription as a string.
         """
         pango_font_desc = Pango.FontDescription.from_string(font_desc)
         self._css_values["textview"]["font-family"] = pango_font_desc.get_family()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]