Yaouh! out (update for tangogps maps)

Tilman Baumann tilman at baumann.name
Fri Jan 16 16:12:19 CET 2009

Tilman Baumann wrote:
> Carlo Minucci wrote:
>> Xavier Cremaschi ha scritto:
>>> Carlo Minucci a écrit :
>>>> http://wiki.openmoko.org/wiki/Yaouh!
>>>> i a simple interface for update the maps of tangogps
>>>> it's optimized for low band usage
>>> Just a question : how can you check the remote file without dowloading 
>>> it before ? Do you use etag [1] to do that ?
>> yes
>> etag
>> i check with this:
>> curl -I http://tile.openstreetmap.org/$file | grep ETag | cut -d "\"" -f 2
>> do you know a better way?
> Doen't python have a http lib? Calling external apps is not really the 
> fastest and safest way.

Untested code:

  import httplib
  conn = httplib.HTTPConnection("tile.openstreetmap.org")
  conn.request("HEAD", "/file...")
  r1 = conn.getresponse()
  print r1.status, r1.reason
  etag = getheader("ETag")
  print etag

And if stuff was new, make GET instead of HEAD

Drucken Sie diese Mail bitte nur auf Recyclingpapier aus.
Please print this mail only on recycled paper.

More information about the community mailing list