# HG changeset patch # User Paul Boddie # Date 1367416098 -7200 # Node ID 457a5817ee498b0c5f7c80edd8555eacd3070b53 # Parent 816ebc7dcb6adb581e79dd118668761cc68bbdcc Expanded the stored metadata for cached remote resources. diff -r 816ebc7dcb6a -r 457a5817ee49 MoinRemoteSupport.py --- a/MoinRemoteSupport.py Tue Apr 30 20:07:38 2013 +0200 +++ b/MoinRemoteSupport.py Wed May 01 15:48:18 2013 +0200 @@ -21,7 +21,11 @@ If the resource cannot be downloaded and cached, None is returned. Otherwise, the form of the data is as follows: - url content-type-header content-body + url + [ content-type-header ] + [ other-header ]* + + content-body """ # See if the URL is cached. @@ -49,6 +53,10 @@ try: cache_entry.write(url + "\n") cache_entry.write((f.headers.get("content-type") or "") + "\n") + for key, value in f.headers.items(): + if key.lower() != "content-type": + cache_entry.write("%s: %s\n" % (key, value)) + cache_entry.write("\n") cache_entry.write(f.read()) finally: cache_entry.close() diff -r 816ebc7dcb6a -r 457a5817ee49 README.txt --- a/README.txt Tue Apr 30 20:07:38 2013 +0200 +++ b/README.txt Wed May 01 15:48:18 2013 +0200 @@ -70,6 +70,8 @@ * Added macro argument parsing from MoinForms and a function to find parsers by content type. * Introduced support for reverse iteration over stored items. + * Expanded the stored metadata for cached remote resources in + MoinRemoteSupport. New in MoinSupport 0.2 (Changes since MoinSupport 0.1) ------------------------------------------------------