Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing last modified in json

  • Loading branch information...
commit 2cbd515ff0a2bc229b0fd63943b5d90369dbcee5 1 parent a46dc29
Gabriel Handford authored
View
1  app/controllers/s3.py
@@ -5,6 +5,7 @@
import datetime
from google.appengine.ext import webapp
+from google.appengine.runtime import DeadlineExceededError
from mako.template import Template
from mako.lookup import TemplateLookup
View
21 app/views/index.mako
@@ -71,7 +71,26 @@
<hr/>
<h2>JSON</h2>
- <p>Get list bucket response in JSON format with <em>format=json</em> URL parameter.<br/> For example, <a href="/s3hub?format=rss">http://shrub.appspot.com/s3hub?format=json</a> <br/><span class="disclaimer">See limitations below.</span></p>
+ <p>Get list bucket response in JSON format with <em>format=json</em> URL parameter.<br/> For example, <a href="/s3hub?format=json">http://shrub.appspot.com/s3hub?format=json</a> <br/><span class="disclaimer">See limitations below.</span><br/><br/></p>
+<pre>
+{"maxKeys": "1000",
+ "prefix": "",
+ "commonPrefixes": [],
+ "isTrucated": false,
+ "contents": [
+ {"etag": "\"ee8a4f9c22e98b6dfb1781650eaffe01\"",
+ "storageClass": "STANDARD",
+ "key": "S3Hub-0.5.1.dmg",
+ "lastModified": 1213991757,
+ "bucket": "s3hub",
+ "size": 2635399},
+ {"etag": "\"cb8d95164e9696823f7b01b306840896\"",
+ "storageClass": "STANDARD",
+ "key": "S3Hub-0.5.10.dmg",
+ "lastModified": 1213991757,
+ "bucket": "s3hub",
+ "size": 2779097}, ...
+</pre>
<hr/>
View
2  lib/simplejson/encoder.py
@@ -313,7 +313,7 @@ def _iterencode(self, o, markers=None):
for chunk in self._iterencode_dict(o, markers):
yield chunk
elif isinstance(o, datetime.datetime):
- key = time.mktime(o.timetuple())
+ yield str(int(time.mktime(o.timetuple())))
else:
if markers is not None:
markerid = id(o)
View
3  shrub/file.py
@@ -39,7 +39,8 @@ def __str__(self):
return u'%s/%s' % (self.bucket, self.key)
def __json__(self):
- return dict(bucket=self.bucket, key=self.key, etag=self.etag, lastModified=self.last_modified, size=self.size, storageClass=self.storage_class)
+ return dict(bucket=self.bucket, key=self.key, etag=self.etag, lastModified=self.last_modified,
+ size=self.size, storageClass=self.storage_class)
def name_with_prefix(self, prefix):
if prefix:
Please sign in to comment.
Something went wrong with that request. Please try again.