diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-08-26 20:29:02 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-08-26 20:29:02 +0100 |
commit | 793bb869d223dbdabd3d69ca9094ace9521fdcae (patch) | |
tree | f7c2ca5e225e7ff4f8a61418a4c30f8e0beecb21 /codegen.py | |
parent | 7d62d02e18f6ee9238515c486a3a5fb38def0252 (diff) | |
download | rabbitmq-server-793bb869d223dbdabd3d69ca9094ace9521fdcae.tar.gz |
support default empty AMQP tablesbug17070
Diffstat (limited to 'codegen.py')
-rw-r--r-- | codegen.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -45,11 +45,20 @@ erlangTypeMap = { 'timestamp': 'timestamp', } +# Coming up with a proper encoding of AMQP tables in JSON is too much +# hassle at this stage. Given that the only default value we are +# interested in is for the empty table, we only support that. +def convertTable(d): + if len(d) == 0: + return "[]" + else: raise 'Non-empty table defaults not supported', d + erlangDefaultValueTypeConvMap = { bool : lambda x: str(x).lower(), str : lambda x: "<<\"" + x + "\">>", int : lambda x: str(x), - float : lambda x: str(x) + float : lambda x: str(x), + dict: convertTable } def erlangize(s): |