[Checkins] SVN: zope.testbrowser/trunk/ Fix getLink documentation
Encolpe DEGOUTE
encolpe.degoute at free.fr
Wed Feb 13 21:31:03 EST 2008
Log message for revision 83809:
Fix getLink documentation
Changed:
U zope.testbrowser/trunk/CHANGES.txt
U zope.testbrowser/trunk/src/zope/testbrowser/README.txt
-=-
Modified: zope.testbrowser/trunk/CHANGES.txt
===================================================================
--- zope.testbrowser/trunk/CHANGES.txt 2008-02-14 00:46:02 UTC (rev 83808)
+++ zope.testbrowser/trunk/CHANGES.txt 2008-02-14 02:31:00 UTC (rev 83809)
@@ -12,7 +12,10 @@
- Fix https://bugs.launchpad.net/bugs/149517 by adding zope.interface and
zope.schema as real dependencies
+- Fix browser.getLink documentation that was not updated since last API
+ modification.
+
3.4.2 (2007-10-31)
------------------
Modified: zope.testbrowser/trunk/src/zope/testbrowser/README.txt
===================================================================
--- zope.testbrowser/trunk/src/zope/testbrowser/README.txt 2008-02-14 00:46:02 UTC (rev 83808)
+++ zope.testbrowser/trunk/src/zope/testbrowser/README.txt 2008-02-14 02:31:00 UTC (rev 83809)
@@ -209,13 +209,16 @@
'...Message: <em>By Link Text with Normalization</em>...'
When a link text matches more than one link, by default the first one is
-chosen. You can, however, specify the index of the link and thus retrieve a
-later matching link:
+chosen. In previous versions there was an index parameter that is now
+removed. You can, however, use a regular expression and thus retrieve a
+better matching link:
>>> browser.getLink('Link Text')
<Link text='Link Text' ...>
- >>> browser.getLink('Link Text', index=1)
+ >>> import re
+ >>> searched_link = re.compile('^Link .* Normalization', re.S|re.M)
+ >>> browser.getLink(searched_link)
<Link text='Link Text with Whitespace Normalization (and parens)' ...>
Note that clicking a link object after its browser page has expired will
@@ -226,7 +229,7 @@
...
ExpiredError
-You can also find the link by its URL,
+You can also find the link by its URL or its id,
>>> browser.open('http://localhost/@@/testbrowser/navigate.html')
>>> browser.contents
More information about the Checkins
mailing list