@ -546,8 +546,6 @@ def getParameters():
config [ " path " ] = config [ " path " ] [ : - 1 ]
config [ " path " ] = config [ " path " ] [ : - 1 ]
else :
else :
break
break
if not config [ " path " ] :
config [ " path " ] = ' . '
elif o in ( " --api " ) :
elif o in ( " --api " ) :
config [ ' api ' ] = a
config [ ' api ' ] = a
elif o in ( " --index " ) :
elif o in ( " --index " ) :
@ -609,7 +607,8 @@ Write --help for help."""
config [ ' index ' ] = ' http:// ' + config [ ' index ' ]
config [ ' index ' ] = ' http:// ' + config [ ' index ' ]
#calculating path, if not defined by user with --path=
#calculating path, if not defined by user with --path=
config [ ' path ' ] = ' ./ %s - %s -wikidump ' % ( domain2prefix ( config = config ) , config [ ' date ' ] )
if not config [ ' path ' ] :
config [ ' path ' ] = ' ./ %s - %s -wikidump ' % ( domain2prefix ( config = config ) , config [ ' date ' ] )
return config , other
return config , other
@ -637,7 +636,9 @@ def main():
originalpath = config [ ' path ' ] # to avoid concat blabla-2, blabla-2-3, and so on...
originalpath = config [ ' path ' ] # to avoid concat blabla-2, blabla-2-3, and so on...
while not other [ ' resume ' ] and os . path . isdir ( config [ ' path ' ] ) : #do not enter if resume is request from begining
while not other [ ' resume ' ] and os . path . isdir ( config [ ' path ' ] ) : #do not enter if resume is request from begining
print ' \n Warning!: " %s " path exists ' % ( config [ ' path ' ] )
print ' \n Warning!: " %s " path exists ' % ( config [ ' path ' ] )
reply = raw_input ( ' There is a dump in " %s " , probably incomplete. \n If you choose resume, to avoid conflicts, the parameters you have chosen in the current session will be ignored \n and the parameters available in " %s / %s " will be loaded. \n Do you want to resume ([yes, y], otherwise no)? ' % ( config [ ' path ' ] , config [ ' path ' ] , configfilename ) )
reply = ' '
while reply not in [ ' yes ' , ' y ' , ' no ' , ' n ' ] :
reply = raw_input ( ' There is a dump in " %s " , probably incomplete. \n If you choose resume, to avoid conflicts, the parameters you have chosen in the current session will be ignored \n and the parameters available in " %s / %s " will be loaded. \n Do you want to resume ([yes, y], [no, n])? ' % ( config [ ' path ' ] , config [ ' path ' ] , configfilename ) )
if reply . lower ( ) in [ ' yes ' , ' y ' ] :
if reply . lower ( ) in [ ' yes ' , ' y ' ] :
if not os . path . isfile ( ' %s / %s ' % ( config [ ' path ' ] , configfilename ) ) :
if not os . path . isfile ( ' %s / %s ' % ( config [ ' path ' ] , configfilename ) ) :
print ' No config file found. I can \' t resume. Aborting. '
print ' No config file found. I can \' t resume. Aborting. '
@ -645,8 +646,9 @@ def main():
print ' You have selected YES '
print ' You have selected YES '
other [ ' resume ' ] = True
other [ ' resume ' ] = True
break
break
el se :
el if reply . lower ( ) in [ ' no ' , ' n ' ] :
print ' You have selected NO '
print ' You have selected NO '
other [ ' resume ' ] = False
config [ ' path ' ] = ' %s - %d ' % ( originalpath , c )
config [ ' path ' ] = ' %s - %d ' % ( originalpath , c )
print ' Trying " %s " ... ' % ( config [ ' path ' ] )
print ' Trying " %s " ... ' % ( config [ ' path ' ] )
c + = 1
c + = 1