Browse Source

bug fixes: mongodb and s3 bucket

Steve Nyemba 4 năm trước cách đây
mục cha
commit
9eb46954cd
3 tập tin đã thay đổi với 2 bổ sung7 xóa
  1. 1 1
      setup.py
  2. 1 1
      transport/mongo.py
  3. 0 5
      transport/s3.py

+ 1 - 1
setup.py

@@ -8,7 +8,7 @@ def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read() 
 args    = {
     "name":"data-transport",
-    "version":"1.2.4",
+    "version":"1.2.6",
     "author":"The Phi Technology LLC","author_email":"info@the-phi.com",
     "license":"MIT",
     "packages":["transport"]}

+ 1 - 1
transport/mongo.py

@@ -71,7 +71,7 @@ class MongoReader(Mongo,Reader):
                     key = 'n'
                 if 'cursor' in out and out['cursor'][key] :
                     r += list(out['cursor'][key])
-                elif out[key]:
+                elif key in out and out[key]:
                     r.append (out[key]) 
                     # yield out['cursor'][key]
                 if key not in ['firstBatch','nextBatch'] or ('cursor' in out and out['cursor']['id']  == 0) :

+ 0 - 5
transport/s3.py

@@ -128,8 +128,3 @@ class s3Writer(s3,Writer) :
 		self.s3.upload_fileobj(file,self.bucket_name,self.filename)
 		pass
 		
-if __name__ == '__main__'		:
-	p = {'access_key':'AKIAJO7KII27XH3TCPJQ','secret_key':'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'}
-	reader = s3Reader(**p)
-	buckets = reader.buckets()
-	print(reader.list(name  = buckets[0]))