Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mobile'
Browse files Browse the repository at this point in the history
  • Loading branch information
javipalanca committed May 8, 2013
2 parents d785870 + 13e5cac commit 038572a
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 11 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
@@ -1,2 +1,3 @@
SPARQLWrapper
unittest-xml-reporting
unittest-xml-reporting
simplejson
2 changes: 1 addition & 1 deletion spade/ACLMessage.py
Expand Up @@ -569,4 +569,4 @@ def loadJSON(self, jsonstring):
self.setProtocol(p['protocol'])

if "conversation-id" in p:
self.setConversationId(p["conversation-id"])
self.setConversationId(p["conversation-id"])
5 changes: 4 additions & 1 deletion spade/AID.py
Expand Up @@ -220,7 +220,10 @@ def asJSON(self):
"""
returns a version of an AID in JSON format
"""
import json
try:
import json
except ImportError:
import simplejson as json
return json.dumps(self.asContentObject())

def asXML(self):
Expand Down
5 changes: 4 additions & 1 deletion spade/Agent.py
Expand Up @@ -42,7 +42,10 @@
import colors
import cPickle as pickle
import uuid
import json
try:
import json
except ImportError:
import simplejson as json


import DF
Expand Down
5 changes: 4 additions & 1 deletion spade/Envelope.py
@@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
import types
import AID
import json
try:
import json
except ImportError:
import simplejson as json


class Envelope:
Expand Down
7 changes: 3 additions & 4 deletions spade/Platform.py
Expand Up @@ -8,7 +8,6 @@
import spade.ACLMessage
import spade.BasicFipaDateTime


#from spade.wui import require_login
from os.path import abspath

Expand Down Expand Up @@ -110,12 +109,12 @@ def _setup(self):
self.wui.setPort(8008)
self.wui.start()

import spade.mtp
import mtps
# Load MTPs
for name, _mtp in self.config.acc.mtp.items():
try:
mod = "spade.mtp." + name
mod = __import__(mod, globals(), locals(), [name])
mod = "mtps."+name
mod = __import__(mod, globals(), locals(),[name])
self.mtps[_mtp['protocol']] = mod.INSTANCE(name, self.config, self)
except Exception, e:
self.DEBUG("EXCEPTION IMPORTING MTPS: " + str(e), 'err', 'acc')
Expand Down
2 changes: 1 addition & 1 deletion spade/kb.py
Expand Up @@ -157,7 +157,7 @@ def configure(self, typ, sentence=None, path=None):
else:
raise KBConfigurationFailed("Could not import " + str(typ) + " KB.")

except KBConfigurationFailed as e:
except KBConfigurationFailed, e:
#self.myAgent.DEBUG(str(e)+" Using Fol KB.", 'warn')
typ = "Spade"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion test/httpTestCase.py
Expand Up @@ -5,6 +5,11 @@
import unittest
import BaseHTTPServer

try:
import json
except ImportError:
import simplejson as json

import spade

host = "127.0.0.1"
Expand Down Expand Up @@ -174,7 +179,6 @@ def do_POST(self):
self.server.done = True

def testSend2HTTPServer(self):
import json
template = spade.Behaviour.ACLTemplate()
#template.setSender(self.Aaid)
template.setContent("HTTPtestSendJSONMsg")
Expand Down

0 comments on commit 038572a

Please sign in to comment.