Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#2761 closed defect (fixed)

Typos in trac.web.href.Href docstring

Reported by: Tim Hatch <trac@…> Owned by: Christian Boos
Priority: low Milestone: 0.10
Component: general Version: devel
Severity: trivial Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

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 (0)

Change History (2)

comment:1 by Christian Boos, 19 years ago

Milestone: 0.10
Owner: changed from Jonas Borgström to Christian Boos
Severity: minortrivial

Patch looks OK.

comment:2 by Christian Boos, 19 years ago

Resolution: fixed
Status: newclosed

Patch applied in r3161, thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.