Permalink
Browse files

solved installation issues. Also solved a problem importing mtps when…

… spade is installed
  • Loading branch information...
javipalanca committed Nov 25, 2012
1 parent 3b6a6dc commit 942b4a0297b23600e17a0d5d006256350f812b94
Showing with 14 additions and 21 deletions.
  1. +2 −0 MANIFEST.in
  2. +2 −1 setup.py
  3. +8 −20 spade/Platform.py
  4. +2 −0 spade/mtp/__init__.py
View
@@ -0,0 +1,2 @@
+include COPYING
+graft spade/templates
View
@@ -35,9 +35,10 @@
author_email='jpalanca@gmail.com',
url='http://spade2.googlecode.com',
package_dir={'spade': 'spade'},
- packages=['spade', 'xmpp', 'xmppd', 'xmppd.modules', 'xmppd.socker', 'tlslite', 'tlslite.utils', 'tlslite.integration'],
+ packages=['spade','spade.mtp', '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/*.*'],},
+ include_package_data=True,
ext_modules=exts,
classifiers=[
'Development Status :: 5 - Production/Stable',
View
@@ -130,32 +130,20 @@ def _setup(self):
self.wui.setPort(8008)
self.wui.start()
+ import mtp
# Load MTPs
- for name, mtp in self.config.acc.mtp.items():
- #self.mtps[mtp.protocol] = mtp.instance(name)
+ for name, _mtp in self.config.acc.mtp.items():
try:
- mtp_path = "." + os.sep + "spade" + os.sep + "mtp"
- if os.path.exists(mtp_path):
- sys.path.append(mtp_path)
- else:
- # This path should come from the config file . . .
- mtp_path = os.sep + "usr" + os.sep + "share" + os.sep + "spade" + os.sep + "mtp"
- sys.path.append(mtp_path)
-
- mod = __import__(name)
- self.mtps[mtp['protocol']] = mod.INSTANCE(name, self.config, self)
-
+ mod = "mtp."+name
+ mod = __import__(mod, globals(), locals(),[name])
+ self.mtps[_mtp['protocol']] = mod.INSTANCE(name, self.config, self)
except Exception, e:
- print "EXCEPTION IMPORTING MTPS: ", str(e)
- _exception = sys.exc_info()
- if _exception[0]:
- msg = '\n' + ''.join(traceback.format_exception(_exception[0], _exception[1], _exception[2])).rstrip()
- print msg
+ self.DEBUG("EXCEPTION IMPORTING MTPS: "+ str(e), 'err','acc')
def takeDown(self):
- for k, mtp in self.mtps.items():
+ for k, _mtp in self.mtps.items():
try:
- mtp.stop()
+ _mtp.stop()
del self.mtps[k]
except:
pass
View
@@ -0,0 +1,2 @@
+import http
+import simba

0 comments on commit 942b4a0

Please sign in to comment.