Merge lp:~javier.collado/utah/docstrings-use-raises-instead-of-throws into lp:utah

Proposed by Javier Collado
Status: Merged
Approved by: Max Brustkern
Approved revision: 762
Merged at revision: 762
Proposed branch: lp:~javier.collado/utah/docstrings-use-raises-instead-of-throws
Merge into: lp:utah
Diff against target: 67 lines (+8/-8)
2 files modified
utah/preseed.py (+4/-4)
utah/url.py (+4/-4)
To merge this branch: bzr merge lp:~javier.collado/utah/docstrings-use-raises-instead-of-throws
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
Review via email: mp+136891@code.launchpad.net

Description of the change

This branch just replaces 'throws' with 'raises' in docstrings.

This is in line with sphinx documentation
(http://sphinx-doc.org/domains.html#info-field-lists) and looks more consistent
with the python syntax for exceptions.

To post a comment you must log in.
762. By Javier Collado

Replace :return: with :returns:

This is to be consistent with the rest of the docstrings.

Revision history for this message
Javier Collado (javier.collado) wrote :

I realized that in some place I was using :return: instead of :returns:, so I
changed that as well to be consistent.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'utah/preseed.py'
--- utah/preseed.py 2012-11-14 19:55:36 +0000
+++ utah/preseed.py 2012-11-29 10:17:22 +0000
@@ -109,9 +109,9 @@
109109
110 :param lines: Any iterable that yields preseed file configuration lines110 :param lines: Any iterable that yields preseed file configuration lines
111 :type lines: iterable111 :type lines: iterable
112 :return: Preseed file object with information parsed112 :returns: Preseed file object with information parsed
113 :rtype: :class:`Preseed`113 :rtype: :class:`Preseed`
114 :throws ParsingError:114 :raises ParsingError:
115 If there's a problem parsing some configuration lines, this115 If there's a problem parsing some configuration lines, this
116 exception will be raised with the line number where the problem was116 exception will be raised with the line number where the problem was
117 detected in the message.117 detected in the message.
@@ -320,7 +320,7 @@
320 :type old_text: `string` | `None`320 :type old_text: `string` | `None`
321 :param new_text: New property text321 :param new_text: New property text
322 :type new_text: `string`322 :type new_text: `string`
323 :throws DuplicatedQuestionName:323 :raises DuplicatedQuestionName:
324 If the updated property is `qname` and the new text is already324 If the updated property is `qname` and the new text is already
325 taken by other section which would break the access to a section by325 taken by other section which would break the access to a section by
326 the question name.326 the question name.
@@ -694,7 +694,7 @@
694694
695 :parameter raw_lines: An iterable that yields one line at a time695 :parameter raw_lines: An iterable that yields one line at a time
696 :type raw_lines: `iterable`696 :type raw_lines: `iterable`
697 :throws ParsingError:697 :raises ParsingError:
698 If the configuration lines don't follow the expected format above, this698 If the configuration lines don't follow the expected format above, this
699 exception will be raised.699 exception will be raised.
700700
701701
=== modified file 'utah/url.py'
--- utah/url.py 2012-11-27 09:58:06 +0000
+++ utah/url.py 2012-11-29 10:17:22 +0000
@@ -64,7 +64,7 @@
64 :type url: `basestring`64 :type url: `basestring`
65 :returns: The url passed as argument when it's valid and readable.65 :returns: The url passed as argument when it's valid and readable.
66 :rtype: `basestring`66 :rtype: `basestring`
67 :throws URLNotFound:67 :raises URLNotFound:
68 When there's a problem opening the URL or isn't found.68 When there's a problem opening the URL or isn't found.
6969
70 :Example:70 :Example:
@@ -111,9 +111,9 @@
111 can be used to open the file the same way as111 can be used to open the file the same way as
112 any other files.112 any other files.
113 :rtype: `basestring`113 :rtype: `basestring`
114 :throws URLNotFound:114 :raises URLNotFound:
115 when the path to the file doesn't exist.115 when the path to the file doesn't exist.
116 :throws URLNotReadable:116 :raises URLNotReadable:
117 when the user doesn't have read permissions to open the file.117 when the user doesn't have read permissions to open the file.
118118
119 :Example:119 :Example:
@@ -161,7 +161,7 @@
161 :type url: `basestring`161 :type url: `basestring`
162 :returns: URL or path to local file162 :returns: URL or path to local file
163 :rtype: `basestring`163 :rtype: `basestring`
164 :throws argparse.ArgumentTypeError:164 :raises argparse.ArgumentTypeError:
165165
166 when the URL is invalid or unreadable. In any case, the error message166 when the URL is invalid or unreadable. In any case, the error message
167 will provide information to be displayed by the167 will provide information to be displayed by the

Subscribers

People subscribed via source and target branches