1
1
"""
2
- Manager for dealing with uploading/managing files on S3
2
+ Manager for dealing with uploading/managing files on Amazon S3
3
3
"""
4
4
from boto .s3 .connection import S3Connection
5
5
from boto .s3 .key import Key
10
10
11
11
class S3LoggingBucket (object ):
12
12
"""
13
- A class to upload log files from tests to S3.
13
+ A class to upload log files from tests to Amazon S3.
14
14
Those files can then be shared easily.
15
15
"""
16
16
@@ -35,7 +35,7 @@ def get_bucket(self):
35
35
36
36
def upload_file (self , file_name , file_path ):
37
37
""" Upload a given file from the file_path to the bucket
38
- with the new name/path file_name. """
38
+ with the new name/path file_name. """
39
39
upload_key = Key (bucket = self .bucket , name = file_name )
40
40
content_type = "text/plain"
41
41
if file_name .endswith (".html" ):
@@ -53,11 +53,10 @@ def upload_file(self, file_name, file_path):
53
53
upload_key .make_public ()
54
54
except Exception :
55
55
pass
56
- return file_name
57
56
58
57
def upload_index_file (self , test_address , timestamp ):
59
- """ Create an index.html file with links to all the log files we
60
- just uploaded. """
58
+ """ Create an index.html file with links to all the log files
59
+ that were just uploaded. """
61
60
global already_uploaded_files
62
61
already_uploaded_files = list (set (already_uploaded_files ))
63
62
already_uploaded_files .sort ()
@@ -75,7 +74,7 @@ def upload_index_file(self, test_address, timestamp):
75
74
76
75
def save_uploaded_file_names (self , files ):
77
76
""" Keep a record of all file names that've been uploaded. Upload log
78
- files related to each test after its execution. Once done, use
79
- already_uploaded_files to create an index file. """
77
+ files related to each test after its execution. Once done, use
78
+ already_uploaded_files to create an index file. """
80
79
global already_uploaded_files
81
80
already_uploaded_files .extend (files )
0 commit comments