@@ -72,11 +72,11 @@ def upload(wikis, config={}, uploadeddumps=[]):
72
72
c = 0
73
73
for dump in dumps :
74
74
wikidate = dump .split ('-' )[1 ]
75
- item = get_item ( 'wiki-' + wikiname )
76
- appended = False
75
+ identifier = 'wiki-' + wikiname
76
+ item = get_item ( identifier )
77
77
if item .exists and config .append_date and not config .admin :
78
- item = get_item ( 'wiki -' + wikiname + '-' + wikidate )
79
- appended = True
78
+ identifier += ' -' + wikidate
79
+ item = get_item ( identifier )
80
80
if dump in uploadeddumps :
81
81
if config .prune_directories :
82
82
rmline = 'rm -rf %s-%s-wikidump/' % (wikiname , wikidate )
@@ -248,10 +248,7 @@ def upload(wikis, config={}, uploadeddumps=[]):
248
248
try :
249
249
item .upload (dumpdir + '/' + dump , metadata = md , access_key = accesskey , secret_key = secretkey , verbose = True , queue_derive = False )
250
250
item .modify_metadata (md ) # update
251
- if appended :
252
- print 'You can find it in https://archive.org/details/wiki-%s-%s' % (wikiname , wikidate )
253
- else :
254
- print 'You can find it in https://archive.org/details/wiki-%s' % (wikiname )
251
+ print 'You can find it in https://archive.org/details/%s' % (identifier )
255
252
uploadeddumps .append (dump )
256
253
except Exception as e :
257
254
print wiki , dump , 'Error when uploading?'
0 commit comments