B
    0a                 @   st   d dl mZ d dl mZ d dl mZ d dl mZ d dlZd dlZddlmZ ddl	m
Z
mZ dd	lmZ d
d ZdS )    )absolute_import)division)print_function)unicode_literalsN   )	DocWriter)generate_sections_filewrite_sections_file)Transformerc       	   	   C   s&  t  }|d |jdddddd |jdd	dd
ddd |jddddg dd |jdddddd || dd  } | jstddtjkrtjd }tjd }tj	|d|g}ng }|
| j t| j|}| jr
t|}t| jd}t|| W d Q R X nt|| j}|| j dS )Ngirfilez-oz--outputZstoreoutputzDirectory to write output to)actiondesthelpz-lz
--languagelanguageczOutput language)r   r   defaultr   z-Iz--add-include-pathappendinclude_pathsz!include paths for other GIR filesz-sz--write-sections-file
store_truewrite_sectionsz&Generate and write out a sections filer   zmissing output parameterZ UNINSTALLED_INTROSPECTION_SRCDIRZ"UNINSTALLED_INTROSPECTION_BUILDDIRZgirwr   )argparseArgumentParseradd_argument
parse_argsr   
SystemExitosenvironpathjoinextendr   r
   Zparse_from_girr   r   r   openr	   r   r   write)	argsparserZ
top_srcdirZtop_builddirZextra_include_dirstransformerZsections_filefpwriter r)   3/usr/lib/gobject-introspection/giscanner/docmain.pydoc_main"   s@    



r+   )Z
__future__r   r   r   r   r   r   Z	docwriterr   Zsectionparserr   r	   r&   r
   r+   r)   r)   r)   r*   <module>   s   