#NEWLINE# def convert_to_dict( self ) : #NEWLINE# #INDENT# 'Convert Docpie into a JSONlizable dict.\n\n        Use it in this way:\n        pie = Docpie(__doc__)\n        json.dumps(pie.convert_2_dict())\n\n        Note the `extra` info will be lost if you costomize that,\n        because a function is not JSONlizable.\n        You can use `set_config(extra={...})` to set it back.\n        ' #NEWLINE# config = { #NEWLINE# #INDENT# 'stdopt' : self . stdopt , #NEWLINE# 'attachopt' : self . attachopt , #NEWLINE# 'attachvalue' : self . attachvalue , #NEWLINE# 'auto2dashes' : self . auto2dashes , #NEWLINE# 'case_sensitive' : self . case_sensitive , #NEWLINE# 'namedoptions' : self . namedoptions , #NEWLINE# 'appearedonly' : self . appeared_only , #NEWLINE# 'optionsfirst' : self . options_first , #NEWLINE# 'option_name' : usage . option_name , #NEWLINE# 'usage_name' : self . usage_name , #NEWLINE# 'name' : self . name , #NEWLINE# 'help' : self . help , #NEWLINE# 'version' : self . version , #NEWLINE# #UNINDENT# } #NEWLINE# text = { #NEWLINE# #INDENT# 'doc' : self . doc , #NEWLINE# 'usage_text' : self . usage_text , #NEWLINE# 'option_sections' : self . option_sections , #NEWLINE# #UNINDENT# } #NEWLINE# option = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( title , options ) in self . options . items ( ) : #NEWLINE# #INDENT# option [ title ] = [ convert_2_dict ( x ) for x in options ] #NEWLINE# #UNINDENT# usage = [ convert_2_dict ( x ) for x in self . usages ] #NEWLINE# return { #NEWLINE# #INDENT# '__version__' : self . _version , #NEWLINE# '__class__' : 'Docpie' , #NEWLINE# '__config__' : config , #NEWLINE# '__text__' : text , #NEWLINE# 'option' : option , #NEWLINE# 'usage' : usage , #NEWLINE# 'option_names' : [ list ( x ) for x in self . opt_names ] , #NEWLINE# 'opt_names_required_max_args' : self . opt_names_required_max_args , #NEWLINE# #UNINDENT# }