- Misc fixes, todo list.

This commit is contained in:
ccremers 2006-08-08 16:16:28 +00:00
parent 9697e22414
commit 6f59760a70
3 changed files with 23 additions and 34 deletions

View File

@ -10,7 +10,6 @@ import os
import os.path
import sys
import StringIO
import tempfile
#---------------------------------------------------------------------------
@ -37,6 +36,7 @@ class Scyther(object):
# Init
self.spdl = None
self.inputfile = None
self.options = ""
self.claims = None
self.errors = None
self.errorcount = 0
@ -103,13 +103,19 @@ class Scyther(object):
stderr.close()
if self.xml:
self.validxml = False
if len(output) > 0:
if output.startswith("<scyther>"):
self.validxml = True
if self.validxml:
xmlfile = StringIO.StringIO(output)
reader = XMLReader.XMLReader()
self.claims = reader.readXML(xmlfile)
else:
# no output...
# no xml output... store whatever comes out
self.claims = []
self.output = output
result = self.claims
else:
self.output = output
@ -130,8 +136,8 @@ class Scyther(object):
if self.errorcount > 0:
return "%i errors:\n%s" % (self.errorcount, "\n".join(self.errors))
else:
if self.xml:
s = "Claim results:\n"
if self.xml and self.validxml:
s = "Verification results:\n"
for cl in self.claims:
s += str(cl) + "\n"
return s
@ -141,29 +147,3 @@ class Scyther(object):
return "Scyther has not been run yet."
def basicTest():
# Some basic testing
#if sys.platform.startswith('win'):
# print "Dir test"
# p = os.popen("dir")
# print p.read()
# print p.close()
# confirm("See the dir?")
#
print "I don't know what to test now."
def simpleRun(args):
x = Scyther()
x.options = args
x.verify()
return x
if __name__ == '__main__':
pars = sys.argv[1:]
if len(pars) == 0:
basicTest()
else:
print simpleRun(" ".join(pars))

View File

@ -1,6 +1,6 @@
#!/usr/bin/python
#
# Scyther interface
# python wrapper for the Scyther command-line tool
#
#---------------------------------------------------------------------------

View File

@ -1,8 +1,17 @@
URGENT
- Splash screen image is not located correctly (after dir move), causing
the windows version to break.
TO BE DONE
- Verify buttons need redesign and must be smaller (or maybe simply move
to text)
- Windows buttons are not visible now.
WOULD LIKE TO HAVE
- Attacks are not kept centered well.
- Ideally we somehow color the correct/incorrect tags in the editor.
- Line numbering is needed for the editor window otherwise you cannot
interpret attacks.
- Bottom bar should have obvious 'view' buttons for attacks that provide
views, to guide the user.
interpret attacks. Probably use wx.Py editor things.
- Preferences window.
- Save in local file on close.
- Scyther executable should be able to be set by means of preferences.