Edgewall Software

Ticket #2761 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

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:

  1. First has a title that mentions how it behaves with None as a positional argument... yet there's no None.
  2. In Href.something, Href is a class instance, not a function.
  3. 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

Changed 3 years ago by cboos

  • owner changed from jonas to cboos
  • severity changed from minor to trivial
  • milestone set to 0.10

Patch looks OK.

Changed 3 years ago by cboos

  • status changed from new to closed
  • resolution set to fixed

Patch applied in r3161, thanks!

Add/Change #2761 (Typos in trac.web.href.Href docstring)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cboos. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.