Skip to content

Commit

Permalink
validate function
Browse files Browse the repository at this point in the history
  • Loading branch information
h4ck3rm1k3 committed Aug 14, 2012
1 parent 0ec2c9c commit 2351fe8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions speedydeletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import replace
import xmlreader


from shove import Shove
file_store = Shove('file://wikiaupload')

Expand All @@ -22,6 +23,9 @@ def signal_handler(signal, frame):
import subprocess

def main(*args):

print "ARGS:%s\n" % sys.argv

genFactory = pagegenerators.GeneratorFactory()
# If xmlfilename is None, references will be loaded from the live wiki.
xmlfilename = None
Expand All @@ -44,10 +48,13 @@ def main(*args):
print "cannot open %s\n" % xmlfilename
exit (0)

tempfile = "%s.tmp" % xmlfilename

status = subprocess.call("xmllint --recover %s -o %s" % (xmlfilename,tempfile) , shell=True)
print "status %d\n" % status
if sys.argv[1] == "--validate" :
tempfile = "%s.tmp" % xmlfilename
status = subprocess.call("xmllint --recover %s -o %s" % (xmlfilename,tempfile) , shell=True)
print "status %d\n" % status
else:
tempfile = xmlfilename


dump = xmlreader.XmlDump(tempfile)
count = 0
Expand Down

0 comments on commit 2351fe8

Please sign in to comment.