[feedparser commit] r288 - in trunk/feedparser: . docs/xml tests/wellformed/http

1 view
Skip to first unread message

codesite...@google.com

unread,
Mar 15, 2008, 4:23:14 PM3/15/08
to feedparse...@googlegroups.com
Author: pilgrim
Date: Thu Mar 13 21:36:05 2008
New Revision: 288

Added:
trunk/feedparser/tests/wellformed/http/headers_no_etag.xml
Modified:
trunk/feedparser/docs/xml/feedparser.xml
trunk/feedparser/docs/xml/version.xml
trunk/feedparser/feedparser.py
trunk/feedparser/feedparsertest.py

Log:
only create results.etag if etag is present [closes issue 6/1662900]

Modified: trunk/feedparser/docs/xml/feedparser.xml
==============================================================================
--- trunk/feedparser/docs/xml/feedparser.xml (original)
+++ trunk/feedparser/docs/xml/feedparser.xml Thu Mar 13 21:36:05 2008
@@ -2807,6 +2807,7 @@
</sectioninfo>
<title>Basic Command Line Usage</title>
<para>TODO</para>
+
</section>

<section id="commandline.arguments">
@@ -2819,6 +2820,28 @@
</sectioninfo>
<title>Optional Arguments</title>
<para>TODO</para>
+
+<example id="example.commandline.help">
+<title>Available options</title>
+<screen><prompt>mark@atlantis$ </prompt><userinput>./feedparser.py --help</userinput>
+<computeroutput>usage: feedparser.py [options] url_or_filename_or_-
+
+options:
+ --version show program's version number and exit
+ -h, --help show this help message and exit
+ -A AGENT, --user-agent=AGENT
+ User-Agent for HTTP URLs
+ -e URL, --referer=URL, --referrer=URL
+ Referrer for HTTP URLs
+ -t TAG, --etag=TAG ETag/If-None-Match for HTTP URLs
+ -m DATE, --last-modified=DATE
+ Last-modified/If-Modified-Since for HTTP URLs
(any supported date format)
+ -f FORMAT, --format=FORMAT
+ output results in FORMAT (text, pprint)
+ -v, --verbose write debugging information to stderr
+</computeroutput></screen>
+</example>
+
</section>

<section id="commandline.outputformats">

Modified: trunk/feedparser/docs/xml/version.xml
==============================================================================
--- trunk/feedparser/docs/xml/version.xml (original)
+++ trunk/feedparser/docs/xml/version.xml Thu Mar 13 21:36:05 2008
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
-<!ENTITY fileversion "2006-01-10">
+<!ENTITY fileversion "2008-03-12">

Modified: trunk/feedparser/feedparser.py
==============================================================================
--- trunk/feedparser/feedparser.py (original)
+++ trunk/feedparser/feedparser.py Thu Mar 13 21:36:05 2008
@@ -3375,7 +3375,9 @@
# save HTTP headers
if hasattr(f, 'info'):
info = f.info()
- result['etag'] = info.getheader('ETag')
+ etag = info.getheader('ETag')
+ if etag:
+ result['etag'] = etag
last_modified = info.getheader('Last-Modified')
if last_modified:
result['modified'] = _parse_date(last_modified)

Modified: trunk/feedparser/feedparsertest.py
==============================================================================
--- trunk/feedparser/feedparsertest.py (original)
+++ trunk/feedparser/feedparsertest.py Thu Mar 13 21:36:05 2008
@@ -1,3 +1,4 @@
+#!/usr/bin/env python
"""$Id$"""

__author__ = "Mark Pilgrim <http://diveintomark.org/>"

Added: trunk/feedparser/tests/wellformed/http/headers_no_etag.xml
==============================================================================
--- (empty file)
+++ trunk/feedparser/tests/wellformed/http/headers_no_etag.xml Thu Mar
13 21:36:05 2008
@@ -0,0 +1,7 @@
+<!--
+Header: X-Foo: bar
+Description: etag should not exist in results if not present in HTTP headers
+Expect: not bozo and not globals().has_key('etag')
+-->
+<feed xmlns="http://www.w3.org/2005/Atom">
+</feed>
\ No newline at end of file

Reply all
Reply to author
Forward
0 new messages