Permalink
Browse files

(1) xmppd/xmppd.py: Solved multisession_thread daemonic bug.

(2) spade/Agent.py: Solved kill issues whith daemonic threads, added hasBehaviour method, if register fails AgentNotRegisteredError exception is raised. 
(3) spade/MessageReceiver.py: _receive is not blocked anymore, checking periodically if was killed. 
(4) test/kbTestCase.py: skipped SPARQL tests. 
(5) spade/mtp/http.py: solved blocking thread. Now has a timeout. 
(6) spade/peer2peer.py: P2P behavior is also no longer blocking. Uses a timeout. 
(7) spade/wui.py: another daemonic thread bug solved. 
(8) configure.py: Added default admin password for WUI. The default password is 'secret'. 
(9) All files have been modified according to the PEP8 conventions. 
(10) All files encoded in UTF-8. 
This is the last commit using subversion. We switch to git. Pray what you know...
  • Loading branch information...
javipalanca committed Nov 23, 2012
1 parent 992ef4b commit 9c13b8b85114de7909e33cf2cf5e8adc14ae8a48
Showing with 21,816 additions and 19,593 deletions.
  1. +1,333 −0 ChangeLog
  2. +75 −79 configure.py
  3. +63 −0 doc/manual/html/spade.basic.features.html
  4. +146 −140 runspade.py
  5. +549 −566 spade/ACLMessage.py
  6. +525 −541 spade/ACLParser.py
  7. +291 −289 spade/AID.py
  8. +749 −762 spade/AMS.py
  9. +569 −532 spade/Agent.py
  10. +123 −127 spade/BasicFipaDateTime.py
  11. +147 −128 spade/Behaviour.py
  12. +395 −359 spade/DF.py
  13. +41 −40 spade/ECLiPSeKB.py
  14. +132 −130 spade/Envelope.py
  15. +1 −1 spade/FIPAMessage.py
  16. +6 −4 spade/FlexQueue.py
  17. +44 −45 spade/Flora2KB.py
  18. +7 −8 spade/MTP.py
  19. +109 −86 spade/MessageReceiver.py
  20. +721 −720 spade/Organization.py
  21. +721 −722 spade/Organization_new.py
  22. +51 −71 spade/Platform.py
  23. +437 −471 spade/RDF0Parser.py
  24. +75 −74 spade/RPC.py
  25. +36 −36 spade/ReceivedObject.py
  26. +49 −50 spade/SIMBA.py
  27. +84 −84 spade/SL0Parser.py
  28. +40 −39 spade/SPARQLKB.py
  29. +41 −40 spade/SWIKB.py
  30. +134 −153 spade/SpadeConfigParser.py
  31. +1,146 −1,157 spade/Unit.py
  32. +1,102 −1,113 spade/Unit_new.py
  33. +324 −409 spade/XMLCodec.py
  34. +41 −40 spade/XSBKB.py
  35. +1 −0 spade/__init__.py
  36. +110 −102 spade/bdi.py
  37. +17 −17 spade/colors.py
  38. +43 −44 spade/content.py
  39. +97 −94 spade/dblite.py
  40. +83 −79 spade/fipa.py
  41. +87 −72 spade/kb.py
  42. +369 −214 spade/logic.py
  43. +5 −5 spade/msgtypes.py
  44. +61 −89 spade/mtp/http.py
  45. +75 −91 spade/mtp/simba.py
  46. +2 −2 spade/odict.py
  47. +103 −67 spade/peer2peer.py
  48. +54 −65 spade/pubsub.py
  49. +53 −52 spade/pygooglechart.py
  50. +800 −753 spade/pyparsing.py
  51. +167 −150 spade/pyratemp.py
  52. +422 −406 spade/pyxf.py
  53. +27 −19 spade/socialnetwork.py
  54. +34 −28 spade/spade_backend.py
  55. +282 −223 spade/tbcbp.py
  56. +120 −99 spade/wui.py
  57. +22 −24 test.py
  58. +85 −87 test/aidTestCase.py
  59. +72 −69 test/amsTestCase.py
  60. +41 −38 test/basicTestCase.py
  61. +79 −70 test/bdiTestCase.py
  62. +30 −32 test/coTestCase.py
  63. +171 −169 test/dadTestCase.py
  64. +235 −254 test/dfTestCase.py
  65. +24 −25 test/eventbehavTestCase.py
  66. +25 −22 test/factsTestCase.py
  67. +57 −49 test/httpTestCase.py
  68. +29 −26 test/jsonTestCase.py
  69. +64 −63 test/kbTestCase.py
  70. +93 −88 test/p2pTestCase.py
  71. +65 −62 test/pubsubTestCase.py
  72. +140 −132 test/rpcTestCase.py
  73. +64 −0 test/socialTestCase.py
  74. +128 −128 test/tbcbpTestCase.py
  75. +19 −16 test/xfTestCase.py
  76. +10 −8 xmppd/generate-cert.py
  77. +6 −7 xmppd/locales.py
  78. +24 −11 xmppd/modules/__init__.py
  79. +142 −135 xmppd/modules/config.py
  80. +152 −147 xmppd/modules/db_fake.py
  81. +57 −47 xmppd/modules/dialback.py
  82. +40 −37 xmppd/modules/jep0077.py
  83. +35 −29 xmppd/modules/jep0078.py
  84. +44 −42 xmppd/modules/message.py
  85. +3,316 −3,241 xmppd/modules/muc.py
  86. +10 −9 xmppd/modules/oob.py
  87. +45 −52 xmppd/modules/pubsub.py
  88. +158 −146 xmppd/modules/roster.py
  89. +878 −746 xmppd/modules/router.py
  90. +236 −192 xmppd/modules/stream.py
  91. +255 −267 xmppd/modules/webadmin.py
  92. +221 −214 xmppd/modules/wq.py
  93. +71 −67 xmppd/socker/router.py
  94. +331 −287 xmppd/socker/socker.py
  95. +16 −16 xmppd/tools/client.py
  96. +31 −23 xmppd/tools/ping.py
  97. +18 −15 xmppd/tools/xsend.py
  98. +958 −814 xmppd/xmppd.py
View
1,333 ChangeLog

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -9,68 +9,68 @@
globalhostname = ""
def generateCode():
# Fill the template with the correct data
global jabber_template
global globalhostname
path=""
path = ""
if os.name == "posix":
# If no hostname was previously specified, get one from the system
if globalhostname == "":
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 == "":
if globalhostname == "":
hostname = socket.gethostbyaddr(socket.gethostname())[0]
else:
hostname = globalhostname
#path = "usr"+os.sep+"share"+os.sep+"spade"
if hostname == "localhost":
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)])
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>
</platform>
<acc>
<hostname>acc."""+hostname+"""</hostname>
<password>"""+acc_passwd+"""</password>
<port>5222</port>
#MTPS#
</acc>
<ams>
<hostname>ams."""+hostname+"""</hostname>
<password>"""+ams_passwd+"""</password>
<port>5222</port>
</ams>
<df>
<hostname>df."""+hostname+"""</hostname>
<password>"""+df_passwd+"""</password>
<port>5222</port>
</df>
</spade>
<spade>
<platform>
<hostname>""" + hostname + """</hostname>
<port>5222</port>
<adminpasswd>secret</adminpasswd>
</platform>
<acc>
<hostname>acc.""" + hostname + """</hostname>
<password>""" + acc_passwd + """</password>
<port>5222</port>
#MTPS#
</acc>
<ams>
<hostname>ams.""" + hostname + """</hostname>
<password>""" + ams_passwd + """</password>
<port>5222</port>
</ams>
<df>
<hostname>df.""" + hostname + """</hostname>
<password>""" + df_passwd + """</password>
<port>5222</port>
</df>
</spade>
"""
# Now fill the MTPs information
@@ -85,14 +85,14 @@ def generateCode():
# mtp_str = mtp_str + """\t\t\t</mtp>\n\n"""
# except Exception, e:
# print "EXCEPTION GETTING MTPS: ", str(e)
# Fill the data
mtp_str = '''t\t\t<mtp name="http">\n\t\t\t\t<instance>http</instance>\n'''
mtp_str = mtp_str + """\t\t\t\t<protocol>http</protocol>\n"""
mtp_str = mtp_str + """\t\t\t</mtp>\n\n"""
mtp_str = '''
<mtp name="http">
<instance>http</instance>
<protocol>http</protocol>
</mtp>'''
spadexml = spadexml.replace("#MTPS#", mtp_str)
# GUS: By default, no MTPs, thank you
#spadexml = spadexml.replace("#MTPS#", "")
file = open("spade.xml", "w+")
file.write(spadexml)
@@ -101,49 +101,46 @@ def generateCode():
# 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>
<server>
<servernames>
<name>''' + hostname + '''</name>
</servernames>
<certificate file="xmppd.pem"/>
<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>
<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>
<server>
<servernames>
<name>''' + hostname + '''</name>
</servernames>
<certificate file="xmppd.pem"/>
<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("xmppd.xml", "w+")
file.write(xmppdxml)
file.close()
if __name__ == '__main__':
# We look for a command line parameter
if len(sys.argv) > 1:
@@ -152,6 +149,5 @@ def generateCode():
else:
# There is no parameter (i.e. macho-mode)
pass
generateCode()
generateCode()
@@ -0,0 +1,63 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="styles.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="index.html" title="SPADE User's Manual">
<link rel="up" href="spade.basic.html" title="Chapter 1. Basic Concepts">
<link rel="prev" href="spade.basic.spadelibrary.html" title="The SPADE Agent Library">
<link rel="next" href="spade.basic.whatsnext.html" title="What's Next?">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center"></th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="spade.basic.spadelibrary.html">Prev</a> </td>
<th width="60%" align="center">Chapter 1. Basic Concepts</th>
<td width="20%" align="right"> <a accesskey="n" href="spade.basic.whatsnext.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="section">
<div class="titlepage"></div>
<p>
The main features of SPADE are:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Developed using Python</p></li>
<li class="listitem"><p>Covers the FIPA standard</p></li>
<li class="listitem"><p>Implements four MTPs: XMPP, P2P, HTTP and SIMBA</p></li>
<li class="listitem"><p>Supports two content languages: FIPA-SL and RDF</p></li>
<li class="listitem"><p>SPADE agents do reach their goals by running deliberative and reactive tasks</p></li>
<li class="listitem"><p>Has a web interface to manage the platform</p></li>
<li class="listitem"><p>Allows its execution in several platforms and operating systems</p></li>
<li class="listitem"><p>Presence notification allows the system to determine the current state of the agents in real-time</p></li>
<li class="listitem"><p>Multi-user conference allows agents to create organizations and groups of agents</p></li>
</ul></div>
<p>
</p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="spade.basic.spadelibrary.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="spade.basic.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="spade.basic.whatsnext.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">The SPADE Agent Library </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> What's Next?</td>
</tr>
</table>
</div>
</body>
</html>
Oops, something went wrong.

0 comments on commit 9c13b8b

Please sign in to comment.