2010-12-30 11 views
4

Python APIを使用してPicasaウェブアルバムアルバムの日付を変更できません。それで何時間も過ごしてしまった今、私は絶望的です。コード:Python APIを使用してPicasaウェブアルバムの日付を変更できません

# set values 
remote_album.timestamp.text = str(get_published_as_timestamp()) 
remote_album.published.text = published + 'T04:01:01.000Z' 

# test before 
print remote_album.published 
print remote_album.published.text 
print remote_album.timestamp.text 

# save it remotely 
remote_album = picasa.Put(remote_album, remote_album.GetEditLink().href, converter=gdata.photos.AlbumEntryFromString) 

# test after 
print remote_album.published.text 
print remote_album.timestamp.text 

# :'-(

出力は次のとおりです。

<ns0:published xmlns:ns0="http://www.w3.org/2005/Atom">2010-12-24T04:01:01.000Z</ns0:published> 
2010-12-24T04:01:01.000Z 
1293148000 
1970-01-15T23:12:28.000Z 
1293148000 

答えて

2

次のように私は私のアルバムのタイムスタンプを変更することができました:

album.timestamp = gdata.photos.Timestamp(
    text="%d000" % time.mktime((2010, 02, 03, 12, 00, 00, -1, -1, -1))) 
updated_album = gd_client.Put(
    album, 
    album.GetEditLink().href, 
    converter=gdata.photos.AlbumEntryFromString) 

明らかに私のコードは(と私は、文字通り唯一持っているあなたは異なっています今日はgdata APIで始まったばかりですが)、新しいタイムスタンプオブジェクトを作成し、それをアルバムのタイムスタンプに割り当てる方法を示しています。

http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_python.html#ModifyAlbums

HTH

関連する問題