py-s3uploader_6.py 426 B

12345678
  1. def upload_file(self,bucket,bucketpath,filepath,ignoredates):
  2. s3connection = S3Connection(self.api,self.secret)
  3. s3bucket = s3connection.get_bucket(bucket)
  4. fullpath = os.path.relpath(os.path.abspath(filepath))
  5. filename = fullpath.split("/")[-1]
  6. bucketfile = "%s/%s" % (bucketpath,filename)
  7. bucketfile = re.sub("/%s$"%filename,"",bucketfile)
  8. self._upload_file(s3connection,s3bucket,fullpath,bucketfile,ignoredates)