upload info in upload stage, ignore ~ temp files
This commit is contained in:
parent
eb0ad68b14
commit
fc72c48908
1 changed files with 15 additions and 1 deletions
|
@ -329,7 +329,9 @@ class Client(object):
|
|||
for filename in sorted(filenames):
|
||||
if isinstance(filename, str):
|
||||
filename = filename.decode('utf-8')
|
||||
if not filename.startswith('._') and not filename in ('.DS_Store', ):
|
||||
if not filename.startswith('._') \
|
||||
and not filename in ('.DS_Store', ) \
|
||||
and not filename.endswith('~'):
|
||||
file_path = os.path.join(dirpath, filename)
|
||||
if os.path.exists(file_path) and os.stat(file_path).st_size>0:
|
||||
files.append(file_path)
|
||||
|
@ -487,6 +489,18 @@ class Client(object):
|
|||
r = self.api.update(post)
|
||||
data = r['data']['data']
|
||||
files = r['data']['file']
|
||||
info = r['data']['info']
|
||||
|
||||
if info:
|
||||
print 'info for %d files requested' % len(info)
|
||||
post = {'info': {}}
|
||||
for oshash in info:
|
||||
i = self.info(oshash)
|
||||
if i:
|
||||
post['info'][oshash] = i
|
||||
if post['info']:
|
||||
print 'uploading info for %d files' % len(post['info'])
|
||||
r = self.api.update(post)
|
||||
|
||||
if files:
|
||||
print 'uploading %s files' % len(files)
|
||||
|
|
Loading…
Reference in a new issue