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
1=== modified file 'utah/preseed.py'
2--- utah/preseed.py 2012-11-14 19:55:36 +0000
3+++ utah/preseed.py 2012-11-29 10:17:22 +0000
4@@ -109,9 +109,9 @@
5
6 :param lines: Any iterable that yields preseed file configuration lines
7 :type lines: iterable
8- :return: Preseed file object with information parsed
9+ :returns: Preseed file object with information parsed
10 :rtype: :class:`Preseed`
11- :throws ParsingError:
12+ :raises ParsingError:
13 If there's a problem parsing some configuration lines, this
14 exception will be raised with the line number where the problem was
15 detected in the message.
16@@ -320,7 +320,7 @@
17 :type old_text: `string` | `None`
18 :param new_text: New property text
19 :type new_text: `string`
20- :throws DuplicatedQuestionName:
21+ :raises DuplicatedQuestionName:
22 If the updated property is `qname` and the new text is already
23 taken by other section which would break the access to a section by
24 the question name.
25@@ -694,7 +694,7 @@
26
27 :parameter raw_lines: An iterable that yields one line at a time
28 :type raw_lines: `iterable`
29- :throws ParsingError:
30+ :raises ParsingError:
31 If the configuration lines don't follow the expected format above, this
32 exception will be raised.
33
34
35=== modified file 'utah/url.py'
36--- utah/url.py 2012-11-27 09:58:06 +0000
37+++ utah/url.py 2012-11-29 10:17:22 +0000
38@@ -64,7 +64,7 @@
39 :type url: `basestring`
40 :returns: The url passed as argument when it's valid and readable.
41 :rtype: `basestring`
42- :throws URLNotFound:
43+ :raises URLNotFound:
44 When there's a problem opening the URL or isn't found.
45
46 :Example:
47@@ -111,9 +111,9 @@
48 can be used to open the file the same way as
49 any other files.
50 :rtype: `basestring`
51- :throws URLNotFound:
52+ :raises URLNotFound:
53 when the path to the file doesn't exist.
54- :throws URLNotReadable:
55+ :raises URLNotReadable:
56 when the user doesn't have read permissions to open the file.
57
58 :Example:
59@@ -161,7 +161,7 @@
60 :type url: `basestring`
61 :returns: URL or path to local file
62 :rtype: `basestring`
63- :throws argparse.ArgumentTypeError:
64+ :raises argparse.ArgumentTypeError:
65
66 when the URL is invalid or unreadable. In any case, the error message
67 will provide information to be displayed by the

Subscribers

People subscribed via source and target branches