1 2# Copyright Aleksey Gurtovoy 2009 3# 4# Distributed under the Boost Software License, Version 1.0. 5# (See accompanying file LICENSE_1_0.txt or copy at 6# http://www.boost.org/LICENSE_1_0.txt) 7 8from docutils.parsers.rst import Directive 9from docutils import nodes 10 11 12class license_and_copyright( nodes.General, nodes.Element ): pass 13 14class LicenseAndCopyright( Directive ): 15 has_content = True 16 17 def run( self ): 18 self.assert_has_content() 19 result_node = license_and_copyright( rawsource = '\n'.join( self.content ) ) 20 self.state.nested_parse( self.content, self.content_offset, result_node ) 21 return [ result_node ] 22