Ticket #2761 (closed defect: fixed)
Typos in trac.web.href.Href docstring
| Reported by: | Tim Hatch <trac@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | low | Milestone: | 0.10 |
| Component: | general | Version: | devel |
| Severity: | trivial | Keywords: | |
| Cc: |
Description
Patch included for three minor docstring changes:
- First has a title that mentions how it behaves with None as a positional argument... yet there's no None.
- In Href.something, Href is a class instance, not a function.
- This was originally phrased as if introduced for the first time, yet it is already mentioned in lines 44-50. Personally I would rather merge the two mentions into one, lines 102-109 don't really say anything that 44-50 don't already.
Index: trac/web/href.py
===================================================================
--- trac/web/href.py (revision 2905)
+++ trac/web/href.py (working copy)
@@ -38,11 +38,11 @@
If a positional parameter evaluates to None, it will be skipped:
- >>> href('ticket', 540, 'attachment')
+ >>> href('ticket', 540, 'attachment', None)
'/trac/ticket/540/attachment'
The first path segment can also be specified by calling an attribute
- of the function, as follows:
+ of the instance, as follows:
>>> href.ticket(540)
'/trac/ticket/540'
@@ -99,8 +99,8 @@
>>> href('ticket', 540)
'https://projects.edgewall.com/trac/ticket/540'
- Finally, the first path segment of the URL to generate can be specified in
- the following way, mainly to improve readability:
+ In common usage, it may improve readability to use the function-calling
+ ability for the first component of the URL as mentioned earlier:
>>> href = Href('/trac')
>>> href.ticket(540)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


