Home | Trees | Indices | Help |
---|
|
object --+ | ??.instance --+ | Emitter --+ | JsonEmitter
/////////////////////////////////////////////////////////////////////////// Lightweight class to ease writting JSON documents, a subset of YAML (http://json.org) Using this class is not recommended -- use YamlEmitter instead. JSON is JavaScript Object Notation, the format for object and array literals in the JavaScript language. It also looks a great deal like nested Python dicts and lists, except for the special JSON values true, false, and null. (Python uses True, False, and None instead. Otherwise, JSON can be embedded directly into Python scripts.) JSON is legal subset of YAML, but leaves out much of YAML's complexity and advanced features. At the present time, there appears to be more library support for JSON than for YAML, especially for reading and parsing. (Both are fairly easy to write, as demonstrated here.) The topmost level of every valid JSON document consists of exactly one map, which is automatically started for you when the class is initialized. When you're finished you should call end(), and then probably flush(). Whitespace is JSON documents is not significant. By default, this class will try to pretty-print, showing the depth of nesting through indentation. When starting a new list or map, you can request that it not be indented (i.e., be printed all on one line), but all lists and maps nested inside it will also be printed without linebreaks, regardless of the requested indentation.
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
__instance_size__ = 32
|
|
|||
Inherited from |
|
__init__( (object)arg1, (OStream)out) -> None : basic/Emitter.hh:356 C++ signature : void __init__(_object*,std::ostream {lvalue})
|
start_doc( (JsonEmitter)arg1) -> None : JSON doesn't support multiple documents, so this just calls end(1) to return you to the top (least-nested) level. C++ signature : void start_doc(basic::JsonEmitter {lvalue})
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Jun 6 00:10:59 2015 | http://epydoc.sourceforge.net |