PyBitmessage-2021-04-27/dev/msgtest.py
Peter Surda 3033520995
Directory maintenance
- rearrange obsolete build scripts
- rearrange working build scripts
- add build / devel scripts I use
- add existing development tests (bloom filter, message encoding, thread
  interrupts)
- add directory descriptions
2016-12-01 16:45:04 +01:00

28 lines
607 B
Python

import importlib
from os import listdir, path
from pprint import pprint
import sys
import traceback
data = {"": "message", "subject": "subject", "body": "body"}
#data = {"": "vote", "msgid": "msgid"}
#data = {"fsck": 1}
import messagetypes
if __name__ == '__main__':
try:
msgType = data[""]
except KeyError:
print "Message type missing"
sys.exit(1)
else:
print "Message type: %s" % (msgType)
msgObj = messagetypes.constructObject(data)
if msgObj is None:
sys.exit(1)
try:
msgObj.process()
except:
pprint(sys.exc_info())