- Misc fixes, todo list.
This commit is contained in:
parent
9697e22414
commit
6f59760a70
@ -10,7 +10,6 @@ import os
|
|||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
import StringIO
|
import StringIO
|
||||||
import tempfile
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -37,6 +36,7 @@ class Scyther(object):
|
|||||||
# Init
|
# Init
|
||||||
self.spdl = None
|
self.spdl = None
|
||||||
self.inputfile = None
|
self.inputfile = None
|
||||||
|
self.options = ""
|
||||||
self.claims = None
|
self.claims = None
|
||||||
self.errors = None
|
self.errors = None
|
||||||
self.errorcount = 0
|
self.errorcount = 0
|
||||||
@ -103,13 +103,19 @@ class Scyther(object):
|
|||||||
stderr.close()
|
stderr.close()
|
||||||
|
|
||||||
if self.xml:
|
if self.xml:
|
||||||
|
self.validxml = False
|
||||||
if len(output) > 0:
|
if len(output) > 0:
|
||||||
|
if output.startswith("<scyther>"):
|
||||||
|
self.validxml = True
|
||||||
|
|
||||||
|
if self.validxml:
|
||||||
xmlfile = StringIO.StringIO(output)
|
xmlfile = StringIO.StringIO(output)
|
||||||
reader = XMLReader.XMLReader()
|
reader = XMLReader.XMLReader()
|
||||||
self.claims = reader.readXML(xmlfile)
|
self.claims = reader.readXML(xmlfile)
|
||||||
else:
|
else:
|
||||||
# no output...
|
# no xml output... store whatever comes out
|
||||||
self.claims = []
|
self.claims = []
|
||||||
|
self.output = output
|
||||||
result = self.claims
|
result = self.claims
|
||||||
else:
|
else:
|
||||||
self.output = output
|
self.output = output
|
||||||
@ -130,8 +136,8 @@ class Scyther(object):
|
|||||||
if self.errorcount > 0:
|
if self.errorcount > 0:
|
||||||
return "%i errors:\n%s" % (self.errorcount, "\n".join(self.errors))
|
return "%i errors:\n%s" % (self.errorcount, "\n".join(self.errors))
|
||||||
else:
|
else:
|
||||||
if self.xml:
|
if self.xml and self.validxml:
|
||||||
s = "Claim results:\n"
|
s = "Verification results:\n"
|
||||||
for cl in self.claims:
|
for cl in self.claims:
|
||||||
s += str(cl) + "\n"
|
s += str(cl) + "\n"
|
||||||
return s
|
return s
|
||||||
@ -141,29 +147,3 @@ class Scyther(object):
|
|||||||
return "Scyther has not been run yet."
|
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))
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
#
|
#
|
||||||
# Scyther interface
|
# python wrapper for the Scyther command-line tool
|
||||||
#
|
#
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
15
gui/todo.txt
15
gui/todo.txt
@ -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.
|
- Ideally we somehow color the correct/incorrect tags in the editor.
|
||||||
- Line numbering is needed for the editor window otherwise you cannot
|
- Line numbering is needed for the editor window otherwise you cannot
|
||||||
interpret attacks.
|
interpret attacks. Probably use wx.Py editor things.
|
||||||
- Bottom bar should have obvious 'view' buttons for attacks that provide
|
|
||||||
views, to guide the user.
|
|
||||||
- Preferences window.
|
- Preferences window.
|
||||||
- Save in local file on close.
|
- Save in local file on close.
|
||||||
- Scyther executable should be able to be set by means of preferences.
|
- Scyther executable should be able to be set by means of preferences.
|
||||||
|
Loading…
Reference in New Issue
Block a user