Browse Source

Fix docstrings formatting

Fix warnings/errors reported by Sphinx
Marek Marczykowski-Górecki 7 years ago
parent
commit
f393ce62dc
6 changed files with 19 additions and 16 deletions
  1. 2 2
      qubes/__init__.py
  2. 3 2
      qubes/backup.py
  3. 2 2
      qubes/dochelpers.py
  4. 1 1
      qubes/tests/__init__.py
  5. 7 5
      qubes/tools/__init__.py
  6. 4 4
      qubes/vm/qubesvm.py

+ 2 - 2
qubes/__init__.py

@@ -325,8 +325,8 @@ class property(object):  # pylint: disable=redefined-builtin,invalid-name
         setter. Can raise QubesValueError if the value is invalid.
         setter. Can raise QubesValueError if the value is invalid.
 
 
         :param untrusted_newvalue: value to be validated
         :param untrusted_newvalue: value to be validated
-        :return sanitized value
-        :raises qubes.exc.QubesValueError
+        :return: sanitized value
+        :raises: qubes.exc.QubesValueError
         '''
         '''
         # do not treat type='str' as sufficient validation
         # do not treat type='str' as sufficient validation
         if self.type is not None and self.type is not str:
         if self.type is not None and self.type is not str:

+ 3 - 2
qubes/backup.py

@@ -119,6 +119,7 @@ class BackupHeader(object):
 
 
         :param untrusted_header_text: header content
         :param untrusted_header_text: header content
         :type untrusted_header_text: basestring
         :type untrusted_header_text: basestring
+
         .. warning::
         .. warning::
             This function may be exposed to not yet verified header,
             This function may be exposed to not yet verified header,
             so is security critical.
             so is security critical.
@@ -864,9 +865,9 @@ def handle_streams(stream_in, streams_out, processes, size_limit=None,
     :param processes: dict of subprocess.Popen objects to monitor
     :param processes: dict of subprocess.Popen objects to monitor
     :param size_limit: int maximum data amount to process
     :param size_limit: int maximum data amount to process
     :param progress_callback: callable function to report progress, will be
     :param progress_callback: callable function to report progress, will be
-    given copied data size (it should accumulate internally)
+        given copied data size (it should accumulate internally)
     :return: failed process name, failed stream name, "size_limit" or None (
     :return: failed process name, failed stream name, "size_limit" or None (
-    no error)
+        no error)
     '''
     '''
     buffer_size = 409600
     buffer_size = 409600
     bytes_copied = 0
     bytes_copied = 0

+ 2 - 2
qubes/dochelpers.py

@@ -249,7 +249,7 @@ class OptionsCheckVisitor(docutils.nodes.SparseNodeVisitor):
             While the documentation talks about a
             While the documentation talks about a
             'SparseNodeVisitor.depart_document()' function, this function does
             'SparseNodeVisitor.depart_document()' function, this function does
             not exists. (For details see implementation of
             not exists. (For details see implementation of
-            :py:method:`NodeVisitor.dispatch_departure()`) So we need to
+            :py:meth:`NodeVisitor.dispatch_departure()`) So we need to
             manually call this.
             manually call this.
         '''
         '''
         if ignored_options is None:
         if ignored_options is None:
@@ -316,7 +316,7 @@ class CommandCheckVisitor(docutils.nodes.SparseNodeVisitor):
             While the documentation talks about a
             While the documentation talks about a
             'SparseNodeVisitor.depart_document()' function, this function does
             'SparseNodeVisitor.depart_document()' function, this function does
             not exists. (For details see implementation of
             not exists. (For details see implementation of
-            :py:method:`NodeVisitor.dispatch_departure()`) So we need to
+            :py:meth:`NodeVisitor.dispatch_departure()`) So we need to
             manually call this.
             manually call this.
         '''
         '''
         if self.sub_commands:
         if self.sub_commands:

+ 1 - 1
qubes/tests/__init__.py

@@ -172,7 +172,7 @@ def expectedFailureIfTemplate(templates):
     Decorator for marking specific test as expected to fail only for some
     Decorator for marking specific test as expected to fail only for some
     templates. Template name is compared as substring, so 'whonix' will
     templates. Template name is compared as substring, so 'whonix' will
     handle both 'whonix-ws' and 'whonix-gw'.
     handle both 'whonix-ws' and 'whonix-gw'.
-     templates can be either a single string, or an iterable
+    templates can be either a single string, or an iterable
     """
     """
     def decorator(func):
     def decorator(func):
         @functools.wraps(func)
         @functools.wraps(func)

+ 7 - 5
qubes/tools/__init__.py

@@ -303,11 +303,13 @@ class QubesArgumentParser(argparse.ArgumentParser):
         :py:class:`qubes.Qubes` object, just add argument for custom xml file
         :py:class:`qubes.Qubes` object, just add argument for custom xml file
     :param bool want_force_root: add ``--force-root`` option
     :param bool want_force_root: add ``--force-root`` option
     :param mixed vmname_nargs: The number of ``VMNAME`` arguments that should be
     :param mixed vmname_nargs: The number of ``VMNAME`` arguments that should be
-            consumed. Values include:
-                - N (an integer) consumes N arguments (and produces a list)
-                - '?' consumes zero or one arguments
-                - '*' consumes zero or more arguments (and produces a list)
-                - '+' consumes one or more arguments (and produces a list)
+        consumed. Values include:
+
+            - N (an integer) consumes N arguments (and produces a list)
+            - '?' consumes zero or one arguments
+            - '*' consumes zero or more arguments (and produces a list)
+            - '+' consumes one or more arguments (and produces a list)
+
     *kwargs* are passed to :py:class:`argparser.ArgumentParser`.
     *kwargs* are passed to :py:class:`argparser.ArgumentParser`.
 
 
     Currenty supported options:
     Currenty supported options:

+ 4 - 4
qubes/vm/qubesvm.py

@@ -578,8 +578,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
 
 
     @property
     @property
     def block_devices(self):
     def block_devices(self):
-        ''' Return all :py:class:`qubes.storage.BlockDevice`s for current domain
-            for serialization in the libvirt XML template as <disk>.
+        ''' Return all :py:class:`qubes.storage.BlockDevice` for current domain
+        for serialization in the libvirt XML template as <disk>.
         '''
         '''
         for v in self.volumes.values():
         for v in self.volumes.values():
             block_dev = v.block_device()
             block_dev = v.block_device()
@@ -1029,7 +1029,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
 
 
         :param str service: service name
         :param str service: service name
         :param qubes.vm.qubesvm.QubesVM source: source domain as presented to
         :param qubes.vm.qubesvm.QubesVM source: source domain as presented to
-        this VM
+            this VM
         :param str user: username to run service as
         :param str user: username to run service as
         :param bool filter_esc: filter escape sequences to protect terminal \
         :param bool filter_esc: filter escape sequences to protect terminal \
             emulator
             emulator
@@ -1199,7 +1199,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
         This function take care to run it as appropriate user.
         This function take care to run it as appropriate user.
 
 
         :param command: command to run (array for
         :param command: command to run (array for
-        :py:meth:`subprocess.check_call`)
+            :py:meth:`subprocess.check_call`)
         :param kwargs: args for :py:meth:`subprocess.check_call`
         :param kwargs: args for :py:meth:`subprocess.check_call`
         :return: None
         :return: None
         '''  # pylint: disable=redefined-builtin
         '''  # pylint: disable=redefined-builtin