mirror of
https://github.com/WikiTeam/wikiteam
synced 2024-11-16 21:27:46 +00:00
git-svn-id: https://wikiteam.googlecode.com/svn/trunk@49 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95
This commit is contained in:
parent
2285c2e0a9
commit
9e397e0464
@ -227,7 +227,7 @@ def getXMLPage(config={}, title=''):
|
|||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
f = urllib2.urlopen(req)
|
f = urllib2.urlopen(req)
|
||||||
except:
|
except:
|
||||||
print 'An error have occurred while retrieving', title
|
print 'An error have occurred while retrieving "%s"' % (title)
|
||||||
print 'Please, resume the dump, --resume'
|
print 'Please, resume the dump, --resume'
|
||||||
sys.exit()
|
sys.exit()
|
||||||
xml = f.read()
|
xml = f.read()
|
||||||
@ -297,7 +297,6 @@ def generateXMLDump(config={}, titles=[], start=''):
|
|||||||
|
|
||||||
xmlfile = open('%s/%s' % (config['path'], xmlfilename), 'a')
|
xmlfile = open('%s/%s' % (config['path'], xmlfilename), 'a')
|
||||||
c = 1
|
c = 1
|
||||||
total = len(titles)
|
|
||||||
for title in titles:
|
for title in titles:
|
||||||
if title == start: #start downloading from start, included
|
if title == start: #start downloading from start, included
|
||||||
lock = False
|
lock = False
|
||||||
@ -305,7 +304,7 @@ def generateXMLDump(config={}, titles=[], start=''):
|
|||||||
continue
|
continue
|
||||||
delay(config=config)
|
delay(config=config)
|
||||||
if c % 10 == 0:
|
if c % 10 == 0:
|
||||||
print ' Downloaded %d pages of %d (%.1f%%)' % (c, total, c/(total/100))
|
print ' Downloaded %d pages' % (c)
|
||||||
xml = getXMLPage(config=config, title=title)
|
xml = getXMLPage(config=config, title=title)
|
||||||
xml = cleanXML(xml=xml)
|
xml = cleanXML(xml=xml)
|
||||||
xmlfile.write(xml)
|
xmlfile.write(xml)
|
||||||
|
Loading…
Reference in New Issue
Block a user