2009/9/17 Flavio Silvestrow <[email protected]>:
> --- a/lib/networktables.py
> +++ b/lib/networktables.py
> -def RemoveNetworkEntry(ip_address, context, iface):
> +def _CheckValidContext(context):
> + """Verify if the context is valid.
> +
> + �...@type context: str
> + �...@param context: one of CONTEXTS
> +
> + �...@raise errors.ConfigurationError: if a check fails
> """
> - Remove an entry in the local Neighbour or Routing table.
There must be an empty line at the end of a docstring.
class Foo:
"""This is a class.
Blah, blah and blah.
"""
def Bar(xyz):
"""Does nothing.
@param xyz: …
"""
raise NotImplementedError()
> + # Check the command return code.
> + # 0: success
> + # 2: non-existent entry, we're fine with that
> + # something else: unknown, raise error
> + if (result.exit_code == 0) or (result.exit_code == 2):
> + pass
> + else:
> + raise errors.CommandError("Can't remove network entry")
if result.exit_code not in (0, 2):
raise …
Regards,
Michael