[spade2] r2245 committed - Preparing for submission to the PyPi index. installation with setup.py...

10 views
Skip to first unread message

spa...@googlecode.com

unread,
Aug 1, 2012, 12:29:34 PM8/1/12
to spade-...@googlegroups.com
Revision: 2245
Author: jpalanca
Date: Wed Aug 1 09:29:11 2012
Log: Preparing for submission to the PyPi index. installation with
setup.py is now fully configured.
http://code.google.com/p/spade2/source/detail?r=2245

Added:
/trunk/README
/trunk/doc/manual
/trunk/spade/templates
Deleted:
/trunk/etc
/trunk/templates
Modified:
/trunk/configure.py
/trunk/runspade.py
/trunk/setup.py
/trunk/spade/wui.py

=======================================
--- /dev/null
+++ /trunk/README Wed Aug 1 09:29:11 2012
@@ -0,0 +1,16 @@
+==========
+SPADE
+==========
+
+
+Welcome to SPADE
+===========================
+SPADE (Smart Python multi-Agent Development Environment) is a Multiagent
and Organizations Platform based on the XMPP/Jabber technology and written
in the Python programming language. This technology offers by itself many
features and facilities that ease the construction of MAS, such as an
existing communication channel, the concepts of users (agents) and servers
(platforms) and an extensible communication protocol based on XML, just
like FIPA-ACL. Many other agent platforms exist, but SPADE is the first to
base its roots on the XMPP technology.
+
+The SPADE Agent Platform does not require (but strongly recommends) the
operation of agents made with the SPADE Agent Library. The platform itself
uses the library to empower its internals, but aside from that, you can
develop your own agents in the programming language of your choice and use
them with SPADE. The only requirement those agents must fulfill is to be
able to communicate through the XMPP protocol. The FIPA-ACL messages will
be embedded in XMPP messages. Be warned, however, that some features of the
whole SPADE experience may not be available if you do not use the SPADE
Agent Library to build your agents.
+
+The SPADE Agent Library
+============================
+The SPADE Agent Library is a module for the Python programming language
for building SPADE agents. It is a collection of classes, functions and
tools for creating new SPADE agents that can work with the SPADE Agent
Platform. Using it is the best way to start developing your own SPADE
agents. In the future, we would like to offer bindings of the SPADE Agent
Library for more programming languages, like Java or C#, but for now only
Python is supported.
+
+If you have worked with Python before, you will find the SPADE Agent
Library easy to understand and use, with classes ready to use and expand,
and many functionalities already built in the library. If you have worked
with other high-level behavioral agent platforms (like Jade or MadKit) you
will find some similarities in the way the library works, although the
agent model present in SPADE is a bit different.
=======================================
--- /trunk/configure.py Thu Apr 16 08:34:31 2009
+++ /trunk/configure.py Wed Aug 1 09:29:11 2012
@@ -10,51 +10,53 @@
globalhostname = ""

def generateCode():
- # Fill the template with the correct data
-
- global jabber_template
- global globalhostname
-
- if os.name == "posix":
- # If no hostname was previously specified, get one from the system
- if globalhostname == "":
- hostname = socket.gethostname()
- else:
- hostname = globalhostname
-
- path = os.sep+"usr"+os.sep+"share"+os.sep+"spade"
- else:
- # If no hostname was previously specified, get one from the system
- if globalhostname == "":
- hostname = socket.gethostbyaddr(socket.gethostname())[0]
- else:
- hostname = globalhostname
- path = "usr"+os.sep+"share"+os.sep+"spade"
-
- if hostname == "localhost":
- hostname = "127.0.0.1"
- print "Translating localhost DNS to IP (127.0.0.1)."
-
- acc_passwd
= "".join([string.ascii_letters[int(random.randint(0,len(string.ascii_letters)-1))]
for a in range(8)])
- ams_passwd
= "".join([string.ascii_letters[int(random.randint(0,len(string.ascii_letters)-1))]
for a in range(8)])
- df_passwd
= "".join([string.ascii_letters[int(random.randint(0,len(string.ascii_letters)-1))]
for a in range(8)])
-
-
- spadexml = """
- <spade>
+ # Fill the template with the correct data
+
+ global jabber_template
+ global globalhostname
+
+ path=""
+
+ if os.name == "posix":
+ # If no hostname was previously specified, get one from the
system
+ if globalhostname == "":
+ hostname = socket.gethostname()
+ else:
+ hostname = globalhostname
+
+ #path = os.sep+"usr"+os.sep+"share"+os.sep+"spade"
+ else:
+ # If no hostname was previously specified, get one from the system
+ if globalhostname == "":
+ hostname = socket.gethostbyaddr(socket.gethostname())[0]
+ else:
+ hostname = globalhostname
+ #path = "usr"+os.sep+"share"+os.sep+"spade"
+
+ if hostname == "localhost":
+ hostname = "127.0.0.1"
+ print "Translating localhost DNS to IP (127.0.0.1)."
+
+ acc_passwd
= "".join([string.ascii_letters[int(random.randint(0,len(string.ascii_letters)-1))]
for a in range(8)])
+ ams_passwd
= "".join([string.ascii_letters[int(random.randint(0,len(string.ascii_letters)-1))]
for a in range(8)])
+ df_passwd
= "".join([string.ascii_letters[int(random.randint(0,len(string.ascii_letters)-1))]
for a in range(8)])
+
+
+ spadexml = """
+ <spade>

<platform>
<hostname>""" + hostname + """</hostname>
<port>5222</port>
- <path>"""+path+"""</path>
+ <path>"""+path+"""</path>
</platform>

<acc>
<hostname>acc."""+hostname+"""</hostname>
<password>"""+acc_passwd+"""</password>
<port>5222</port>
- #MTPS#
- </acc>
+ #MTPS#
+ </acc>

<ams>
<hostname>ams."""+hostname+"""</hostname>
@@ -67,86 +69,86 @@
<password>"""+df_passwd+"""</password>
<port>5222</port>
</df>
-
+
</spade>
- """
-
- # Now fill the MTPs information
- mtp_str = "\n"
- for file in os.listdir("spade/mtp"):
- try:
- # If its a python script
- if file[-3:] == ".py":
- fname = file[:-3]
- mtp_str = mtp_str + '''\t\t\t<mtp name="''' + fname
+ '''">\n\t\t\t\t<instance>''' + fname + '''</instance>\n'''
- mtp_str = mtp_str + """\t\t\t\t<protocol>""" + fname
+ """</protocol>\n"""
- mtp_str = mtp_str + """\t\t\t</mtp>\n\n"""
- except Exception, e:
- print "EXCEPTION GETTING MTPS: ", str(e)
-
- # Fill the data
- # GUS: By default, no MTPs, thank you
- #spadexml = spadexml.replace("#MTPS#", mtp_str)
- spadexml = spadexml.replace("#MTPS#", "")
-
- file = open("etc/spade.xml", "w+")
- file.write(spadexml)
- file.close()
-
- # Generating real xmppd.xml
- if os.name == 'posix':
- xmppdxml = '''
- <server>
- <servernames>
- <name>'''+hostname+'''</name>
- </servernames>
- <certificate file="xmppd.pem"/>
- <spool path="'''+str(os.environ['HOME'])+'''/.spade/spool"/>
- <plugins>
- <MUC jid="muc.'''+hostname+'''" name="SPADE MUC Component"/>
- <WQ jid="wq.'''+hostname+'''" name="SPADE Workgroup Queues"/>
- </plugins>
+ """
+
+ # Now fill the MTPs information
+ #mtp_str = "\n"
+ #for file in os.listdir("spade/mtp"):
+ # try:
+ # # If its a python script
+ # if file[-3:] == ".py":
+ # fname = file[:-3]
+ # mtp_str = mtp_str + '''\t\t\t<mtp name="''' + fname
+ '''">\n\t\t\t\t<instance>''' + fname + '''</instance>\n'''
+ # mtp_str = mtp_str + """\t\t\t\t<protocol>""" + fname
+ """</protocol>\n"""
+ # mtp_str = mtp_str + """\t\t\t</mtp>\n\n"""
+ # except Exception, e:
+ # print "EXCEPTION GETTING MTPS: ", str(e)
+
+ # Fill the data
+ # GUS: By default, no MTPs, thank you
+ #spadexml = spadexml.replace("#MTPS#", mtp_str)
+ spadexml = spadexml.replace("#MTPS#", "")
+
+ file = open("spade.xml", "w+")
+ file.write(spadexml)
+ file.close()
+
+ # Generating real xmppd.xml
+ if os.name == 'posix':
+ xmppdxml = '''
+ <server>
+ <servernames>
+ <name>'''+hostname+'''</name>
+ </servernames>
+ <certificate file="xmppd.pem"/>
+ <spool
path="'''+str(os.environ['HOME'])+'''/.spade/spool"/>
+ <plugins>
+ <MUC jid="muc.'''+hostname+'''" name="SPADE MUC
Component"/>
+ <WQ jid="wq.'''+hostname+'''" name="SPADE Workgroup
Queues"/>
+ </plugins>
<components>
<AMS jid="ams.'''+hostname+'''" name="AMS"
username="ams" password="'''+ams_passwd+'''"/>
<DF jid="df.'''+hostname+'''" name="DF"
username="df" password="'''+df_passwd+'''"/>
<ACC jid="acc.'''+hostname+'''" name="ACC"
username="acc" password="'''+acc_passwd+'''"/>
</components>
- </server>
- '''
- else:
- xmppdxml = '''
- <server>
- <servernames>
- <name>'''+hostname+'''</name>
- </servernames>
- <certificate file="xmppd.pem"/>
- <spool path="usr/share/spade/xmppd/spool"/>
- <plugins>
- <MUC jid="muc.'''+hostname+'''" name="SPADE MUC Component"/>
- <WQ jid="wq.'''+hostname+'''" name="SPADE Workgroup Queues"/>
- </plugins>
+ </server>
+ '''
+ else:
+ xmppdxml = '''
+ <server>
+ <servernames>
+ <name>'''+hostname+'''</name>
+ </servernames>
+ <certificate file="xmppd.pem"/>
+ <spool path="usr/share/spade/xmppd/spool"/>
+ <plugins>
+ <MUC jid="muc.'''+hostname+'''" name="SPADE MUC
Component"/>
+ <WQ jid="wq.'''+hostname+'''" name="SPADE Workgroup
Queues"/>
+ </plugins>
<components>
<AMS jid="ams.'''+hostname+'''" name="AMS"
username="ams" password="'''+ams_passwd+'''"/>
<DF jid="df.'''+hostname+'''" name="DF"
username="df" password="'''+df_passwd+'''"/>
<ACC jid="acc.'''+hostname+'''" name="ACC"
username="acc" password="'''+acc_passwd+'''"/>
</components>
- </server>
- '''
-
- file = open("etc/xmppd.xml", "w+")
- file.write(xmppdxml)
- file.close()
+ </server>
+ '''
+
+ file = open("xmppd.xml", "w+")
+ file.write(xmppdxml)
+ file.close()



if __name__ == '__main__':
# We look for a command line parameter
if len(sys.argv) > 1:
- # There is a parameter
- globalhostname = sys.argv[1]
+ # There is a parameter
+ globalhostname = sys.argv[1]
else:
- # There is no parameter (i.e. macho-mode)
- pass
-
+ # There is no parameter (i.e. macho-mode)
+ pass
+
generateCode()

=======================================
--- /trunk/runspade.py Tue Jul 10 16:56:02 2012
+++ /trunk/runspade.py Wed Aug 1 09:29:11 2012
@@ -10,16 +10,16 @@

from getopt import getopt
try:
- from spade import spade_backend
- from spade import colors
+ from spade import spade_backend
+ from spade import colors
except ImportError, e:
- print "Could not import spade package!!! " + str(e)
+ print "Could not import spade package!!! " + str(e)

from xmppd.xmppd import Server

__author__ = "Gustavo Aranda <gus...@gmail.com> and Javier Palanca
<jpal...@gmail.com>"
-__version__ = "2.0-RC4"
-__copyright__ = "Copyright (C) 2010"
+__version__ = "2.0"
+__copyright__ = "Copyright (C) 2006-2012"
__license__ = "LGPL"


@@ -34,13 +34,13 @@
print " -h, --help display this help text and exit"
print " -v, --version display the version and exit"
print " -d, --debug enable the debug execution"
- print " -c, --configfile load the configuration file
(default "+configfilename+")"
- print " -j, --jabber load the jabber configuration file
(default "+jabberxml+")"
+ print " -c, --configfile load the configuration file (use configure.py
to create one)"
+ print " -j, --jabber load the jabber configuration file (use
configure.py to create one)"
#print " -w, --web load the web interface"
raise SystemExit

def print_version():
- print "SPADE "+colors.color_yellow + __version__ + colors.color_none+"
by Javier Palanca, Gustavo Aranda, Miguel Escriva, Natalia Criado and
others"
+ print "SPADE "+colors.color_yellow + __version__ + colors.color_none+"
by Javier Palanca, Gustavo Aranda, Miguel Escriva and others"
print "gus...@gmail.com - http://spade2.googlecode.com"
raise SystemExit

@@ -63,50 +63,45 @@
dbg = []

if os.name != "posix" or not os.path.exists(jabberxml) or not
os.path.exists(configfilename):
- configfilename = "./etc" + os.sep + "spade.xml"
- configfilename = os.path.abspath(configfilename)
- jabberxml = "./etc" + os.sep + "xmppd.xml"
- jabberxml = os.path.abspath(jabberxml)
+ configfilename = "spade.xml"
+ configfilename = os.path.abspath(configfilename)
+ jabberxml = "xmppd.xml"
+ jabberxml = os.path.abspath(jabberxml)

try:
- for opt, arg in getopt(sys.argv[1:],
+ for opt, arg in getopt(sys.argv[1:],
"hvdwc:j:",
["help", "version", "debug", "web", "configfile=",
"jabber="])[0]:
- if opt in ["-h", "--help"]: print_help()
- elif opt in ["-v", "--version"]: print_version()
- elif opt in ["-c", "--configfile"]: configfilename = arg
- elif opt in ["-j", "--jabber"]: jabberxml = arg
- #elif opt in ["-w", "--web"]: web = True
- elif opt in ["-d", "--debug"]: dbg = ['always']
+ if opt in ["-h", "--help"]: print_help()
+ elif opt in ["-v", "--version"]: print_version()
+ elif opt in ["-c", "--configfile"]: configfilename = arg
+ elif opt in ["-j", "--jabber"]: jabberxml = arg
+ #elif opt in ["-w", "--web"]: web = True
+ elif opt in ["-d", "--debug"]: dbg = ['always']
except:
- pass
+ pass

print "SPADE ", colors.color_yellow + __version__ + colors.color_none, "
<gus...@gmail.com> - http://spade2.googlecode.com"

try:
- import psyco
- psyco.full()
- #print "Using Psyco optimizing compiler."
- #psyco.log(logfile='/tmp/psyco.log')
- #psyco.profile()
- except ImportError: print "W: Psyco optimizing compiler not found."
-
- #print "Using config file " + str(configfilename)
- #print "Using jabber file " + str(jabberxml)
+ import psyco
+ psyco.full()
+ #print "Using Psyco optimizing compiler."
+ #psyco.log(logfile='/tmp/psyco.log')
+ #psyco.profile()
+ except ImportError: pass #print "W: Psyco optimizing compiler not found."
+
sys.stdout.write("Starting SPADE")
sys.stdout.flush()
-
- #parser = SpadeConfigParser.ConfigParser()
- #config = parser.parse(configfilename)
-
sys.stdout.write(".")
sys.stdout.flush()

jabberxml = os.path.abspath(jabberxml)
if not os.path.exists(jabberxml):
print '\n There is no jabber config file (xmppd.xml)'+
colors.color_red + " [failed]" + colors.color_none
- raise SystemExit
-
+ print_help()
+ raise SystemExit
+
if sys.platform[:6] == 'netbsd':
pyvers= 'python'+str(numb)
path = "/usr/pkg/lib" + os.sep + pyvers + "/site-packages/xmppd/"
@@ -122,65 +117,67 @@
thread.start_new_thread(s.run,tuple())

try:
- sys.stdout.write(".")
- sys.stdout.flush()
- if not os.path.exists(configfilename):
- print '\n There is no SPADE config file (spade.xml)'+
colors.color_red + " [failed]" + colors.color_none
- raise SystemExit
- platform = spade_backend.SpadeBackend(configfilename)
- sys.stdout.write(".")
- sys.stdout.flush()
- platform.start()
- sys.stdout.write(".")
- sys.stdout.flush()
- s.DEBUG = platform.DEBUG
-
- sys.stdout.write(".")
- sys.stdout.flush()
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ if not os.path.exists(configfilename):
+ print '\n There is no SPADE config file (spade.xml)'+
colors.color_red + " [failed]" + colors.color_none
+ print_help()
+ raise SystemExit
+
+ platform = spade_backend.SpadeBackend(configfilename)
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ platform.start()
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ s.DEBUG = platform.DEBUG
+
+ sys.stdout.write(".")
+ sys.stdout.flush()


except Exception,e:
_exception = sys.exc_info()
if _exception[0]:
print '\n'+''.join(traceback.format_exception(_exception[0],
_exception[1], _exception[2])).rstrip()
- print str(e)
- print colors.color_red + " [failed]" + colors.color_none
- platform.shutdown()
- s.shutdown("Jabber server terminated...")
- raise SystemExit
+ print str(e)
+ print colors.color_red + " [failed]" + colors.color_none
+ platform.shutdown()
+ s.shutdown("Jabber server terminated...")
+ raise SystemExit

print colors.color_green + " [done]" + colors.color_none
if platform.acc.wui:
- print colors.color_yellow + " [info] " + colors.color_none
+ "WebUserInterface serving at port " + str(platform.acc.wui.port)
+ print "\n "+ colors.color_yellow + " [info] " + colors.color_none
+ "WebUserInterface serving at port " + str(platform.acc.wui.port) + "\n "


alive=True
while alive:
- try:
- time.sleep(1)
- if not platform.alive:
- #The platform died (probable restart). Let's start it over
- platform.shutdown()
- print colors.color_green + "SPADE Platform restarting..." +
colors.color_none
- platform.start()
- print colors.color_green + " [done]" + colors.color_none
- except KeyboardInterrupt:
- sys.stdout.write("Exiting")
- sys.stdout.flush()
- platform.shutdown()
- sys.stdout.write(".")
- sys.stdout.flush()
- s.shutdown("SPADE Jabber server terminated...")
- sys.stdout.write(".")
- sys.stdout.flush()
- time.sleep(1)
- del s
- sys.stdout.write(".")
- sys.stdout.flush()
- print colors.color_green + " Bye." + colors.color_none
- alive=False
- sys.exit(0)
- #sys.exit(0)
+ try:
+ time.sleep(1)
+ if not platform.alive:
+ #The platform died (probable restart). Let's start it over
+ platform.shutdown()
+ print "\n " + colors.color_green + "SPADE Platform
restarting..." + colors.color_none
+ platform.start()
+ print colors.color_green + " [done]" + colors.color_none
+ except KeyboardInterrupt:
+ sys.stdout.write("Exiting")
+ sys.stdout.flush()
+ platform.shutdown()
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ s.shutdown("SPADE Jabber server terminated...")
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ time.sleep(1)
+ del s
+ sys.stdout.write(".")
+ sys.stdout.flush()
+ print colors.color_green + " Bye." + colors.color_none
+ alive=False
+ sys.exit(0)
+
raise SystemExit

if __name__ == '__main__': main()
=======================================
--- /trunk/setup.py Sun Jul 11 16:13:46 2010
+++ /trunk/setup.py Wed Aug 1 09:29:11 2012
@@ -1,18 +1,19 @@
#!/usr/bin/env python
import os
import sys
-from distutils.core import setup, Extension
+#from distutils.core import setup, Extension
+from setuptools import setup, Extension
import glob

from runspade import __version__

#if os.name != "posix":
-# import py2exe
+# import py2exe
try:
- import bdist_mpkg
+ import bdist_mpkg
except:
- # This is not a mac
- pass
+ # This is not a mac
+ pass

if sys.platform == "win32":
ext = Extension("tlslite.utils.win32prng",
@@ -20,64 +21,42 @@
libraries=["advapi32"])
exts = [ext]
else:
- exts = None
-
-
-
-if os.name == "posix":
- #if sys.platform != "darwin":
- setup(name='SPADE',
- version=__version__,
- description='Smart Python multi-Agent Development Environment',
- author='Javier Palanca, Gustavo Aranda, Miguel Escriva, Natalia Criado',
- author_email='jpal...@gmail.com',
- url='http://spade2.googlecode.com',
- package_dir={'spade': 'spade'},
-
#packages=['spade', 'xmpp', 'xmppd', 'xmppd.modules', 'xmppd.locale', 'xmppd.socker', 'tlslite', 'tlslite.utils', 'tlslite.integration'],
-
packages=['spade', 'xmpp', 'xmppd', 'xmppd.modules', 'xmppd.socker', 'tlslite', 'tlslite.utils', 'tlslite.integration'],
-
#scripts=['spade.sh','gspade.sh','gspade.py', 'runspade.py',"tlslite/scripts/tls.py", "tlslite/scripts/tlsdb.py"],
-
scripts=['runspade.py'],#,"tlslite/scripts/tls.py", "tlslite/scripts/tlsdb.py"],
- data_files=[
- ('/etc/spade',['etc/spade.xml']),
- ('/etc/spade',['etc/xmppd.xml']),
- #('/usr/share/spade',['usr/share/spade/rma.glade']),
- #('/usr/share/spade/mtp',glob.glob('usr/share/spade/mtp/*.py')),
- #('/usr/share/doc/spade',['readme.txt']),
- #('/usr/share/doc/spade/',['doc/api.tar.gz']),
-
#('/usr/share/spade/jabberd',['usr/share/spade/jabberd/jabberd','usr/share/spade/jabberd/jabber.xml']),
-
#('/usr/share/spade/jabberd/libs',glob.glob('usr/share/spade/jabberd/libs/*.so')),
-
#('/usr/share/spade/jabberd/spool',['usr/share/spade/jabberd/spool/.spool'])
- ]
- )
-
-else:
- # GUS: What is this case? Meesa not understand :-?
-
- setup(name='SPADE',
- version=__version__,
- description='Smart Python multi-Agent Development Environment',
- author='Javier Palanca, Gustavo Aranda, Miguel Escriva, Natalia Criado',
- author_email='jpal...@gmail.com',
- url='http://spade2.googlecode.com',
- package_dir={'spade': 'spade'},
-
#packages=['spade', 'xmpp', 'xmppd', 'xmppd.filters', 'tlslite', 'tlslite.utils', 'tlslite.integration'],
-
packages=['spade', 'xmpp', 'xmppd', 'xmppd.modules', 'xmppd.socker', 'tlslite', 'tlslite.utils', 'tlslite.integration'],
- #scripts=['spade-rma.py', 'runspade.py'],
-
scripts=['runspade.py'],#,"tlslite/scripts/tls.py", "tlslite/scripts/tlsdb.py"],
-
#console=['gspade.py', 'runspade.py','configure.py',"tlslite/scripts/tls.py", "tlslite/scripts/tlsdb.py"],
- data_files=[
- ('etc',[]),
- #('usr/share/spade',['usr/share/spade/rma.glade']),
- #('.',['readme.txt']),
- #('doc/private',glob.glob('doc/api/private/*')),
- #('doc/public',glob.glob('doc/api/public/*')),
- #('doc',['doc/api/index.html','doc/api/epydoc.css']),
- #('usr/share/spade/jabberd',['usr/share/spade/jabberd/jabberd.exe']),
-
#('usr/share/spade/jabberd/libs',glob.glob('usr/share/spade/jabberd/libs/*.dll')),
- #('usr/share/spade/jabberd/spool',[])
- #('usr/share/spade/xmppd/spool',[])
- ],
- ext_modules=exts
- )
-
-
+ exts = []
+
+with open('README') as file:
+ long_description = file.read()
+
+setup(name='SPADE',
+ version=__version__,
+ license="LGPL",
+ description='Smart Python multi-Agent Development Environment',
+ long_description=long_description,
+ author='Javier Palanca, Gustavo Aranda, Miguel Escriva',
+ author_email='jpal...@gmail.com',
+ url='http://spade2.googlecode.com',
+ package_dir={'spade': 'spade'},
+
packages=['spade', 'xmpp', 'xmppd', 'xmppd.modules', 'xmppd.socker', 'tlslite', 'tlslite.utils', 'tlslite.integration'],
+
scripts=['runspade.py','configure.py'],#,"tlslite/scripts/tls.py", "tlslite/scripts/tlsdb.py"],
+ package_data={'spade':['templates/*.*', 'templates/images/*.*'],},
+ ext_modules=exts,
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: GNU Lesser General Public License v2
(LGPLv2)',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Topic :: Adaptive Technologies',
+ 'Topic :: Scientific/Engineering :: Artificial Intelligence',
+ ],
+ install_requires = [
+ "pexpect",
+ "SPARQLWrapper",
+ "unittest-xml-reporting",
+ ],
+ )
+
+
=======================================
--- /trunk/spade/wui.py Tue Jul 10 16:56:02 2012
+++ /trunk/spade/wui.py Wed Aug 1 09:29:11 2012
@@ -32,7 +32,7 @@
# Try to get SPADE's default template path
tpath = os.path.realpath(pyratemp.__file__) #
/Users/foo/devel/trunk/spade
tpath = tpath.rsplit(os.sep,1) #
["/Users/foo/devel/trunk", "spade"]
- self.spade_path = tpath[0]+os.sep+os.pardir
+ self.spade_path = tpath[0] ###+os.sep+os.pardir
#self.owner.DEBUG("SPADE path: " + self.spade_path,"warn")

self.controllers = {}
@@ -235,7 +235,7 @@
self.copyfile(f, self.wfile)
f.close()
except:
- self.server.owner.owner.DEBUG(sys.exc_info(), "err")
+
self.server.owner.owner.DEBUG(str(sys.exc_info()), "err")

else:
sess = self.Session()
@@ -266,7 +266,7 @@
self.send_header('Location', url)
self.end_headers()
self.wfile.write("")
- return
+ return

except Exception, e:
#No controller
@@ -283,10 +283,10 @@
else:
#olddir = os.path.curdir
#os.chdir(self.server.spade_path)
- authenticated = False
- if hasattr(sess,"user_authenticated"):
- if sess.user_authenticated==True: authenticated=True
- ret['authenticated'] = authenticated
+ authenticated = False
+ if hasattr(sess,"user_authenticated"):
+ if sess.user_authenticated==True:
authenticated=True
+ ret['authenticated'] = authenticated
t =
pyratemp.Template(filename=self.server.owner.spade_path+os.sep+"templates"+os.sep+template,
data=ret)
#print template, ret
#os.chdir(olddir)
Reply all
Reply to author
Forward
0 new messages