dupe file checking was not; adding more basename action to send_file
This commit is contained in:
parent
5a5f190929
commit
d1256d08cc
1 changed files with 5 additions and 4 deletions
|
@ -205,11 +205,12 @@ def handle_progress(transmitted, pending):
|
||||||
logging.debug('%i of %i bytes transmitted (%.2f%%)' % (transmitted, pending, (transmitted/float(pending))*100))
|
logging.debug('%i of %i bytes transmitted (%.2f%%)' % (transmitted, pending, (transmitted/float(pending))*100))
|
||||||
|
|
||||||
def send_file(bucket, filename):
|
def send_file(bucket, filename):
|
||||||
if bucket.get_key(filename):
|
basefilename = os.path.basename(filename)
|
||||||
logging.error('Duplicate filename %s! I hope that is OK.' % filename)
|
if bucket.get_key(basefilename):
|
||||||
|
logging.error('Duplicate filename %s! I hope that is OK.' % basefilename)
|
||||||
k = MyKey(bucket)
|
k = MyKey(bucket)
|
||||||
k.key = os.path.basename(filename)
|
k.key = basefilename
|
||||||
logging.info('Uploading %s...' % os.path.basename(filename))
|
logging.info('Uploading %s...' % basefilename)
|
||||||
|
|
||||||
fd = SlowFile(name=filename, mode='rb')
|
fd = SlowFile(name=filename, mode='rb')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue