diff options
author | José Alburquerque <jaalburqu@svn.gnome.org> | 2010-04-11 15:45:09 -0400 |
---|---|---|
committer | José Alburquerque <jaalburqu@svn.gnome.org> | 2010-04-11 15:45:09 -0400 |
commit | 825fd305f03b726665edca34963978ce27448182 (patch) | |
tree | 0a9d55763b057ba012ca9c63c3358588ab2a9a63 /dsextras.py | |
parent | e9f7fd414e94595e40eb1ba0fc471ca69136d82f (diff) | |
download | pygobject-825fd305f03b726665edca34963978ce27448182.tar.gz pygobject-825fd305f03b726665edca34963978ce27448182.tar.xz pygobject-825fd305f03b726665edca34963978ce27448182.zip |
Update doc extraction tool to handle GObjectIntrospection annotations.
* codegen/docextract.py (FunctionDoc): Renamed class to GtkDoc.
(GtkDoc::annotations): Added a list field to store annotations which
are 2-tuples of (name, value).
(GtkDoc::ret): Modified field to store the return description along
with a list of annotations as described above.
(GtkDoc::params): Now holds a list of 3-tupples: name, description and
annotations (as described above).
(GtkDoc::block_type): Add a field to tell if the comment block is a
function block, signal block or property block.
(GtkDoc::set_type):
(GtkDoc::get_type): Add methods for setting/getting the block type.
(GtkDoc::add_param): Modified to also accept a list of annotations to
be added with the parameter.
(GtkDoc::add_annotation):
(GtkDoc::get_annotations): Added methods to add/get annotations for
the comment block.
(GtkDoc::append_description): Renamed to append_to_description().
(GtkDoc::get_param_description): Removed unused method.
(GtkDoc::get_description): Added method to get block description.
(GtkDoc::add_return): Added method to add a return accepting the first
line of the description and its annotations.
(GtkDoc::append_return): Renamed to append_to_return().
(Regular expressions):
- Made the names of the variables un-abbreviated.
- Added 'since', 'deprecated' and 'rename to' regular expressions.
- Modified the return matching regular expression so that it doesn't
match descriptions that begin with 'Returns ...'. This improves
the docs of many function.
- Added signal and property comment block identifier matching regular
expressions in case those are useful.
- Modified existing identifier matching regular expressions (function,
signal, and property regular expressions) to properly parse
annotations. Also added a regular expression for extracting
annotations from the parameter and return descriptions.
- Refined the function name matching regular expression to only accept
identifiers that begin with a lowercase letter. This eliminates
'SECTION:' matches.
- Finally, grouped commonly related expressions like return_pattern,
since_pattern, etc. into groups (in lists) so that matching those
sections can be done using loops.
(Parsing algorithm): Modified the algorithm to use a functional
approach to parsing. Extra methods like skip_to_comment() and
processs_params() have been added and used in the parse_file()
function to now process the comment blocks.
(parse_dir): Added file processing output to stderr.
* codegen/docextract_to_xml.py (usage): Added function to print out
the usage.
(print_annotations): Added function to print the given list of
annotations.
(options): Added --with-signals (-i), with-properties (-p) and
--with-annotation (-a) to the existing --source-dir (-s) option.
(algorithm): Now prints annotations, if specified. Also, prints
signals and properties correctly (using names like Class::signal-one
for signals and Classs:property) with xml such as <signal
name="...">...</signal>. The return xml is slightly modified with
annotations but this would only be exhibited if annotation xml is
requested.
Diffstat (limited to 'dsextras.py')
0 files changed, 0 insertions, 0 deletions