[virt-tools-list] [PATCH] Fix epydoc parsing errors.

Guido Günther g.guenther at tarent.de
Thu Aug 16 16:51:39 UTC 2012


The API docs can now be built via:

    epydoc  --parse-only -v virtinst
---
 virtinst/CapabilitiesParser.py      |   14 ++++----
 virtinst/DistroInstaller.py         |   11 +++---
 virtinst/Installer.py               |    4 +--
 virtinst/NodeDeviceParser.py        |   13 ++++----
 virtinst/Storage.py                 |    9 ++---
 virtinst/VirtualDisk.py             |    9 ++---
 virtinst/VirtualNetworkInterface.py |    8 ++---
 virtinst/VirtualRedirDevice.py      |    3 --
 virtinst/_util.py                   |   10 +++---
 virtinst/cli.py                     |    3 +-
 virtinst/support.py                 |   63 ++++++++++++++++++-----------------
 virtinst/util.py                    |    6 ++--
 12 files changed, 77 insertions(+), 76 deletions(-)

diff --git a/virtinst/CapabilitiesParser.py b/virtinst/CapabilitiesParser.py
index e0d6523..4c1398c 100644
--- a/virtinst/CapabilitiesParser.py
+++ b/virtinst/CapabilitiesParser.py
@@ -585,9 +585,9 @@ class Capabilities(object):
         Try to determine if fullvirt may be disabled in the bios.
 
         Check is basically:
-        - We support HW virt
-        - We appear to be xen
-        - There are no HVM install options
+            - We support HW virt
+            - We appear to be xen
+            - There are no HVM install options
 
         We don't do this check for KVM, since no KVM options may mean
         KVM isn't installed or the module isn't loaded (and loading the
@@ -688,9 +688,9 @@ def guest_lookup(conn, caps=None, os_type=None, arch=None, type=None,
     we return the default virt type associated with those values. These are
     typically:
 
-    - os_type    : hvm, then xen
-    - type : kvm over plain qemu
-    - arch    : host arch over all others
+        - os_type    : hvm, then xen
+        - type : kvm over plain qemu
+        - arch    : host arch over all others
 
     Otherwise the default will be the first listed in the capabilities xml.
     This function throws C{ValueError}s if any of the requested values are
@@ -699,7 +699,7 @@ def guest_lookup(conn, caps=None, os_type=None, arch=None, type=None,
     @param conn: virConnect instance
     @type conn: libvirt.virConnect
     @param caps: Optional L{Capabilities} instance (saves a lookup)
-    @type conn: L{Capabilities}
+    @type caps: L{Capabilities}
     @param type: Virtualization type ('hvm', 'xen', ...)
     @type type: C{str}
     @param arch: Guest architecture ('x86_64', 'i686' ...)
diff --git a/virtinst/DistroInstaller.py b/virtinst/DistroInstaller.py
index 3a3b5a7..e559431 100644
--- a/virtinst/DistroInstaller.py
+++ b/virtinst/DistroInstaller.py
@@ -175,10 +175,13 @@ class DistroInstaller(Installer.Installer):
     def set_location(self, val):
         """
         Valid values for location:
-        1) it can be a local file (ex. boot.iso), directory (ex. distro tree)
-           or physical device (ex. cdrom media)
-        2) tuple of the form (poolname, volname) pointing to a file or device
-           which will set location as that path
+
+        1) it can be a local file (ex. boot.iso), directory (ex. distro
+        tree) or physical device (ex. cdrom media)
+
+        2) tuple of the form (poolname, volname) pointing to a file or
+        device which will set location as that path
+
         3) http, ftp, or nfs path for an install tree
         """
         is_tuple = False
diff --git a/virtinst/Installer.py b/virtinst/Installer.py
index 0e1a714..796cc86 100644
--- a/virtinst/Installer.py
+++ b/virtinst/Installer.py
@@ -419,9 +419,9 @@ class Installer(XMLBuilderDomain.XMLBuilderDomain):
         """
         Fetch any files needed for installation.
         @param guest: guest instance being installed
-        @type L{Guest}
+        @type guest: L{Guest}
         @param meter: progress meter
-        @type Urlgrabber ProgressMeter
+        @type meter: Urlgrabber ProgressMeter
         """
         raise NotImplementedError("Must be implemented in subclass")
 
diff --git a/virtinst/NodeDeviceParser.py b/virtinst/NodeDeviceParser.py
index 04fc85d..1b6ffa4 100644
--- a/virtinst/NodeDeviceParser.py
+++ b/virtinst/NodeDeviceParser.py
@@ -50,7 +50,7 @@ class NodeDevice(object):
         @param child_dev: Child node device to display in description
         @type child_dev: L{NodeDevice}
 
-        @returns Device description string
+        @returns: Device description string
         @rtype C{str}
         """
         ignore = child_dev
@@ -497,13 +497,12 @@ def devAddressToNodedev(conn, addrstr):
     Look up the passed host device address string as a libvirt node device,
     parse its xml, and return a NodeDevice instance.
 
-    addrstr can be the following formats:
-        bus.addr (ex. 001.003 for a usb device)
-        vendor:product (ex. 0x1234:0x5678 for a usb device
-        (domain:)bus:slot.func (ex. 00:10.0 for a pci device)
-
     @param conn: libvirt.virConnect instance to perform the lookup on
-    @param name: host device string to parse and lookup
+    @param addrstr: host device string to parse and lookup
+        - bus.addr (ex. 001.003 for a usb device)
+        - vendor:product (ex. 0x1234:0x5678 for a usb device
+        - (domain:)bus:slot.func (ex. 00:10.0 for a pci device)
+    @param addrstr: C{str}
     """
     if not is_nodedev_capable(conn):
         raise ValueError(_("Connection does not support host device "
diff --git a/virtinst/Storage.py b/virtinst/Storage.py
index 0397899..7b4a35f 100644
--- a/virtinst/Storage.py
+++ b/virtinst/Storage.py
@@ -235,6 +235,7 @@ class StoragePool(StorageObject):
     Base class for building and installing libvirt storage pool xml
     """
 
+    """@group Types: TYPE_*"""
     TYPE_DIR     = "dir"
     TYPE_FS      = "fs"
     TYPE_NETFS   = "netfs"
@@ -243,7 +244,6 @@ class StoragePool(StorageObject):
     TYPE_ISCSI   = "iscsi"
     TYPE_SCSI    = "scsi"
     TYPE_MPATH   = "mpath"
-    """@group Types: TYPE_*"""
 
     # Pool type descriptions for use in higher level programs
     _types = {}
@@ -261,7 +261,7 @@ class StoragePool(StorageObject):
         Return class associated with passed pool type.
 
         @param ptype: Pool type
-        @type ptype: C{str} member of L{Types}
+        @type ptype: member of I{Types}
         """
         if ptype not in StoragePool._types:
             raise ValueError(_("Unknown storage pool type: %s" % ptype))
@@ -309,7 +309,7 @@ class StoragePool(StorageObject):
 
         @param conn: Libvirt connection
         @param name: Name for the new pool
-        @param pool_type: Pool type string from L{Types}
+        @param pool_type: Pool type string from I{Types}
         @param host: Option host string to poll for sources
         """
         if not support.check_conn_support(conn,
@@ -1022,7 +1022,8 @@ class StorageVolume(StorageObject):
 
         Ex name="test", suffix=".img" -> name-3.img
 
-        @collidelist: An extra list of names to check for collision
+        @param collidelist: An extra list of names to check for collision
+        @type collidelist: C{list}
         @returns: A free name
         @rtype: C{str}
         """
diff --git a/virtinst/VirtualDisk.py b/virtinst/VirtualDisk.py
index e763125..ef4f796 100644
--- a/virtinst/VirtualDisk.py
+++ b/virtinst/VirtualDisk.py
@@ -515,7 +515,7 @@ class VirtualDisk(VirtualDevice):
 
         @return: tuple of
                  (True if regular file, False otherwise, default is True,
-                  max size of storage, default is 0)
+                 max size of storage, default is 0)
         """
         try:
             return _util.stat_disk(path)
@@ -1710,10 +1710,11 @@ class VirtualDisk(VirtualDevice):
     def generate_target(self, skip_targets):
         """
         Generate target device ('hda', 'sdb', etc..) for disk, excluding
-        any targets in list 'skip_targets'. Sets self.target, and returns the
+        any targets in 'skip_targets'. Sets self.target, and returns the
         generated value
-        @param used_targets: list of targets to exclude
-        @type used_targets: C{list}
+
+        @param skip_targets: list of targets to exclude
+        @type skip_targets: C{list}
         @raise ValueError: can't determine target type, no targets available
         @returns generated target
         @rtype C{str}
diff --git a/virtinst/VirtualNetworkInterface.py b/virtinst/VirtualNetworkInterface.py
index 37a51e6..2415176 100644
--- a/virtinst/VirtualNetworkInterface.py
+++ b/virtinst/VirtualNetworkInterface.py
@@ -302,14 +302,12 @@ class VirtualNetworkInterface(VirtualDevice.VirtualDevice):
 
     def is_conflict_net(self, conn, mac=None):
         """
-        is_conflict_net: determines if mac conflicts with others in system
-
-        returns a two element tuple:
+        @returns: a two element tuple:
             first element is True if fatal collision occured
             second element is a string description of the collision.
 
-        Non fatal collisions (mac addr collides with inactive guest) will
-        return (False, "description of collision")
+            Non fatal collisions (mac addr collides with inactive guest) will
+            return (False, "description of collision")
         """
         mac = mac or self.macaddr
         if mac is None:
diff --git a/virtinst/VirtualRedirDevice.py b/virtinst/VirtualRedirDevice.py
index 602d237..43b5869 100644
--- a/virtinst/VirtualRedirDevice.py
+++ b/virtinst/VirtualRedirDevice.py
@@ -39,9 +39,6 @@ class VirtualRedirDevice(VirtualDevice.VirtualDevice):
         """
         @param conn: Connection the device/guest will be installed on
         @type conn: libvirt.virConnect
-        @param nodedev: Optional NodeDevice instance for device being
-                         attached to the guest
-        @type nodedev: L{virtinst.NodeDeviceParser.NodeDevice}
         """
         VirtualDevice.VirtualDevice.__init__(self, conn, parsexml,
                                              parsexmlnode, caps)
diff --git a/virtinst/_util.py b/virtinst/_util.py
index 51cb0d5..c9f6eb9 100644
--- a/virtinst/_util.py
+++ b/virtinst/_util.py
@@ -263,11 +263,11 @@ def generate_name(base, collision_cb, suffix="", lib_collision=True,
                          receives the generated name as its only arg
     @param lib_collision: If true, the collision_cb is not a boolean function,
                           and instead throws a libvirt error on failure
-    @start_num: The number to start at for generating non colliding names
-    @sep: The seperator to use between the basename and the generated number
-          (default is "-")
-    @force_num: Force the generated name to always end with a number
-    @collidelist: An extra list of names to check for collision
+    @param start_num: The number to start at for generating non colliding names
+    @param sep: The seperator to use between the basename and the generated number
+                (default is "-")
+    @param force_num: Force the generated name to always end with a number
+    @param collidelist: An extra list of names to check for collision
     """
     collidelist = collidelist or []
 
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 580eefd..c5b9b17 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1210,8 +1210,7 @@ def parse_optstr(optstr, basedict=None, remove_first=None,
                          returns {"char_type", "pty", "foo" : "bar"}
     @param compress_first: If there are no options of the form opt1=opt2,
                            compress the string to a single option
-
-    Returns a dictionary of {'opt1': 'val1', 'opt2': 'val2'}
+    @returns: a dictionary of {'opt1': 'val1', 'opt2': 'val2'}
     """
     optlist = parse_optstr_tuples(optstr, compress_first=compress_first)
     optdict = basedict or {}
diff --git a/virtinst/support.py b/virtinst/support.py
index 9043799..ebabbef 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -72,36 +72,39 @@ SUPPORT_STREAM_UPLOAD = 6000
 """
 Possible keys:
 
-  "version" : Minimum libvirt version required for this feature. Not used
-              if 'args' provided
-  "force_version" : Demand that version check is met for the checked
-                    libvirt version. Normally we will make a best effort
-                    attempt, because determining the daemon version depends
-                    on a fairly new API call getLibVersion. So for things like
-                    testing API availability (e.g. createXMLFrom) we won't
-                    force the check, but for things like XML options (AC97)
-                    we want to be ABSOLUTELY SURE it is supported so we
-                    don't enable it by default and break guest creation.
-                    This isn't required for versions after >= 0.7.3
-
-  "function" : Function name to check exists. If object not specified,
-               function is checked against libvirt module.
-  "args": Argument tuple to actually test object.function with.
-  "flag": A flag to check exists. This will be appended to the argument
-          list if args are provided, otherwise we will only check against
-          the local libvirt version.
-
-  "drv_version" : A list of tuples of the form
-                  (driver name (e.g qemu, xen, lxc), minimum supported version)
-                 If a hypervisor is not listed, it is assumed to be NOT
-                 SUPPORTED.
-  "drv_libvirt_version" : List of tuples, similar to drv_version, but
-                          the version number is minimum supported _libvirt_
-                          version
-  "hv_version" : A list of tuples of the same form as drv_version, however
-                 listing the actual <domain type='%s'/> from the XML.
-                 example: 'kvm'
-
+  - "version" : Minimum libvirt version required for this feature. Not used
+                if 'args' provided
+
+  - "force_version" : Demand that version check is met for the checked
+                      libvirt version. Normally we will make a best effort
+                      attempt, because determining the daemon version depends
+                      on a fairly new API call getLibVersion. So for things like
+                      testing API availability (e.g. createXMLFrom) we won't
+                      force the check, but for things like XML options (AC97)
+                      we want to be ABSOLUTELY SURE it is supported so we
+                      don't enable it by default and break guest creation.
+                      This isn't required for versions after >= 0.7.3
+
+  - "function" : Function name to check exists. If object not specified,
+                 function is checked against libvirt module.
+
+  - "args": Argument tuple to actually test object.function with.
+
+  - "flag": A flag to check exists. This will be appended to the argument
+            list if args are provided, otherwise we will only check against
+            the local libvirt version.
+
+  - "drv_version" : A list of tuples of the form
+                   (driver name (e.g qemu, xen, lxc), minimum supported version)
+                   If a hypervisor is not listed, it is assumed to be NOT
+                   SUPPORTED.
+
+  - "drv_libvirt_version" : List of tuples, similar to drv_version, but
+                            the version number is minimum supported _libvirt_
+                            version
+  - "hv_version" : A list of tuples of the same form as drv_version, however
+                   listing the actual <domain type='%s'/> from the XML.
+                   example: 'kvm'
 """
 
 _support_dict = {
diff --git a/virtinst/util.py b/virtinst/util.py
index 2977e08..38a04c8 100644
--- a/virtinst/util.py
+++ b/virtinst/util.py
@@ -259,8 +259,8 @@ def get_host_network_devices():
     return device
 
 def get_max_vcpus(conn, type=None):
-    """@conn libvirt connection to poll for max possible vcpus
-       @type optional guest type (kvm, etc.)"""
+    """@param conn: libvirt connection to poll for max possible vcpus
+       @type type: optional guest type (kvm, etc.)"""
     if type is None:
         type = conn.getType()
     try:
@@ -537,7 +537,7 @@ def lookup_pool_by_path(conn, path):
     return the first we find, active or inactive. This iterates over
     all pools and dumps their xml, so it is NOT quick.
     Favor running pools over inactive pools.
-    @return virStoragePool object if found, None otherwise
+    @returns: virStoragePool object if found, None otherwise
     """
     if not is_storage_capable(conn):
         return None
-- 
1.7.10.4




More information about the virt-tools-list mailing list