无法通过 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
I am not able to change a date of my Picasa Web Albums album via Python API. Spent many hours with that and I am hopeless now. Code:
# 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
# :'-(
Output is:
<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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够按如下方式更改我的专辑时间戳:
显然我的代码与您的不同(而且我今天才刚刚开始使用 gdata api),但它展示了如何创建新的时间戳对象并将其分配给专辑时间戳。
http://code.google.com/apis/picasaweb/docs /1.0/developers_guide_python.html#ModifyAlbums
HTH
I was able to change my album timestamp as follows:
Obviously my code is different from yours (and I have literally only just started with the gdata api today), but it shows how to make a new timestamp object and assign it to the album timestamp.
http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_python.html#ModifyAlbums
HTH