<s> """<STR_LIT>""" <EOL> try : <EOL> import json <EOL> except ImportError : <EOL> try : <EOL> import simplejson as json <EOL> except ImportError : <EOL> try : <EOL> from django . utils import simplejson as json <EOL> except ImportError : <EOL> json = None <EOL> from sphinx import addnodes , roles <EOL> from sphinx . util . compat import Directive <EOL> def setup ( app ) : <EOL> app . add_crossref_type ( <EOL> directivename = "<STR_LIT>" , <EOL> rolename = "<STR_LIT>" , <EOL> indextemplate = "<STR_LIT>" , <EOL> ) <EOL> app . add_crossref_type ( <EOL> directivename = "<STR_LIT>" , <EOL> rolename = "<STR_LIT>" , <EOL> indextemplate = "<STR_LIT>" <EOL> ) <EOL> app . add_crossref_type ( <EOL> directivename = "<STR_LIT>" , <EOL> rolename = "<STR_LIT>" , <EOL> indextemplate = "<STR_LIT>" <EOL> ) <EOL> app . add_crossref_type ( <EOL> directivename = "<STR_LIT>" , <EOL> rolename = "<STR_LIT>" , <EOL> indextemplate = "<STR_LIT>" , <EOL> ) <EOL> app . add_config_value ( '<STR_LIT>' , '<STR_LIT>' , True ) <EOL> app . add_directive ( '<STR_LIT>' , VersionDirective ) <EOL> app . add_directive ( '<STR_LIT>' , VersionDirective ) <EOL> class VersionDirective ( Directive ) : <EOL> has_content = True <EOL> required_arguments = <NUM_LIT:1> <EOL> optional_arguments = <NUM_LIT:1> <EOL> final_argument_whitespace = True <EOL> option_spec = { } <EOL> def run ( self ) : <EOL> env = self . state . document . settings . env <EOL> arg0 = self . arguments [ <NUM_LIT:0> ] <EOL> is_nextversion = env . config . rapidsms_next_version == arg0 <EOL> ret = [ ] <EOL> node = addnodes . versionmodified ( ) <EOL> ret . append ( node ) <EOL> if not is_nextversion : <EOL> if len ( self . arguments ) == <NUM_LIT:1> : <EOL> linktext = '<STR_LIT>' % ( arg0 ) <EOL> xrefs = roles . XRefRole ( ) ( '<STR_LIT>' , linktext , linktext , <EOL> self . lineno , self . state ) <EOL> node . extend ( xrefs [ <NUM_LIT:0> ] ) <EOL> node [ '<STR_LIT:version>' ] = arg0 <EOL> else : <EOL> node [ '<STR_LIT:version>' ] = "<STR_LIT>" <EOL> node [ '<STR_LIT:type>' ] = self . name <EOL> if len ( self . arguments ) == <NUM_LIT:2> : <EOL> inodes , messages = self . state . inline_text ( self . arguments [ <NUM_LIT:1> ] , <EOL> self . lineno + <NUM_LIT:1> ) <EOL> node . extend ( inodes ) <EOL> if self . content : <EOL> self . state . nested_parse ( self . content , self . content_offset , <EOL> node ) <EOL> ret = ret + messages <EOL> env . note_versionchange ( node [ '<STR_LIT:type>' ] , node [ '<STR_LIT:version>' ] , node , <EOL> self . lineno ) <EOL> return ret </s>
