- Improved locating binaries etc.
This commit is contained in:
parent
ec9bf11719
commit
17f4f34d23
@ -77,8 +77,8 @@ class SettingsWindow(wx.Panel):
|
|||||||
### MISC expert stuff
|
### MISC expert stuff
|
||||||
grid.titleAdd("Advanced parameters")
|
grid.titleAdd("Advanced parameters")
|
||||||
|
|
||||||
# Bound on the number of classes/attacks
|
# Bound on the number of patterns
|
||||||
self.maxattacks = int(Preference.get('maxattacks','100'))
|
self.maxattacks = int(Preference.get('maxattacks','10'))
|
||||||
stname = Claim.stateDescription(True,2,False)
|
stname = Claim.stateDescription(True,2,False)
|
||||||
atname = Claim.stateDescription(False,2,False)
|
atname = Claim.stateDescription(False,2,False)
|
||||||
txt = "%s/%s" % (stname,atname)
|
txt = "%s/%s" % (stname,atname)
|
||||||
|
@ -19,10 +19,10 @@ from Misc import *
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
""" Globals """
|
"""
|
||||||
bindir="../Bin"
|
The default path for the binaries is set in __init__.py in the (current)
|
||||||
|
directory 'Scyther'.
|
||||||
#---------------------------------------------------------------------------
|
"""
|
||||||
|
|
||||||
def setBinDir(dir):
|
def setBinDir(dir):
|
||||||
global bindir
|
global bindir
|
||||||
@ -36,41 +36,48 @@ def getBinDir():
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
class Scyther(object):
|
def getScytherBackend():
|
||||||
def __init__ ( self):
|
|
||||||
global bindir
|
|
||||||
|
|
||||||
# Where is my executable?
|
# Where is my executable?
|
||||||
#
|
#
|
||||||
# Auto-detect platform and infer executable name from that
|
# Auto-detect platform and infer executable name from that
|
||||||
#
|
#
|
||||||
prefix = os.path.abspath(bindir)
|
|
||||||
if "linux" in sys.platform:
|
if "linux" in sys.platform:
|
||||||
|
|
||||||
""" linux """
|
""" linux """
|
||||||
self.program = os.path.join(prefix,"scyther")
|
scythername = "scyther-linux"
|
||||||
|
|
||||||
elif "darwin" in sys.platform:
|
elif "darwin" in sys.platform:
|
||||||
|
|
||||||
""" OS X """
|
""" OS X """
|
||||||
# Preferably, we test for architecture (PPC/Intel) until we
|
# Preferably, we test for architecture (PPC/Intel) until we
|
||||||
# know how to build a universal binary
|
# know how to build a universal binary
|
||||||
self.program = os.path.join(prefix,"scyther-osx")
|
scythername = "scyther-osx"
|
||||||
|
|
||||||
elif sys.platform.startswith('win'):
|
elif sys.platform.startswith('win'):
|
||||||
|
|
||||||
""" Windows """
|
""" Windows """
|
||||||
# TODO hardcoded for now, bad
|
scythername = "Scyther.exe"
|
||||||
self.program = os.path.join(prefix,"Scyther.exe")
|
|
||||||
if not os.path.isfile(self.program):
|
|
||||||
print "I can't find the Scyther executable at %s" % (self.program)
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
""" Unsupported"""
|
""" Unsupported"""
|
||||||
print "ERROR: I'm sorry, the %s platform is unsupported at the moment" % (sys.platform)
|
print "ERROR: I'm sorry, the %s platform is unsupported at the moment" % (sys.platform)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
program = os.path.join(getBinDir(),scythername)
|
||||||
|
if not os.path.isfile(program):
|
||||||
|
print "I can't find the Scyther executable at %s" % (program)
|
||||||
|
return None
|
||||||
|
|
||||||
|
return program
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class Scyther(object):
|
||||||
|
def __init__ ( self):
|
||||||
|
|
||||||
# Init
|
# Init
|
||||||
|
self.program = getScytherBackend()
|
||||||
self.spdl = None
|
self.spdl = None
|
||||||
self.inputfile = None
|
self.inputfile = None
|
||||||
self.options = ""
|
self.options = ""
|
||||||
@ -105,6 +112,10 @@ class Scyther(object):
|
|||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
def verify(self):
|
def verify(self):
|
||||||
|
""" Should return a list of results """
|
||||||
|
|
||||||
|
if self.program == None:
|
||||||
|
return []
|
||||||
|
|
||||||
# Run Scyther on temp file
|
# Run Scyther on temp file
|
||||||
self.cmd = "\"%s\"" % self.program
|
self.cmd = "\"%s\"" % self.program
|
||||||
|
@ -5,5 +5,7 @@
|
|||||||
# order to correctly find the executables
|
# order to correctly find the executables
|
||||||
#
|
#
|
||||||
import Scyther
|
import Scyther
|
||||||
|
import os.path
|
||||||
|
|
||||||
Scyther.setBinDir(__path__[0])
|
bindir = os.path.join(__path__[0],"..","Bin")
|
||||||
|
Scyther.setBinDir(bindir)
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
SVNDIR=https://svn.win.tue.nl/repos/ecss/trunk/protocols/spdl/scyther
|
|
||||||
TMPDIR=/tmp/ecsslatesscyther
|
|
||||||
VERSIONFILE=$TMPDIR/version.txt
|
|
||||||
SCYTHER=$TMPDIR/scyther
|
|
||||||
|
|
||||||
rm -rf $TMPDIR
|
|
||||||
svn co $SVNDIR $TMPDIR
|
|
||||||
cp scyther $SCYTHER
|
|
||||||
$SCYTHER --version >$VERSIONFILE
|
|
||||||
cat $VERSIONFILE
|
|
||||||
svn commit --file $VERSIONFILE $SCYTHER
|
|
||||||
|
|
||||||
echo "Committed this version to the ECSS repository."
|
|
4
src/copy2gui.sh
Executable file
4
src/copy2gui.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cp scyther-linux ../gui/Bin
|
||||||
|
|
Loading…
Reference in New Issue
Block a user