[Docstring-develop] Latest dps_visit.py
Status: Pre-Alpha
Brought to you by:
goodger
From: Tony J I. (Tibs) <to...@ls...> - 2001-08-23 16:53:48
|
New versions of: http://www.tibsnjoan.co.uk/reST/dps_visit.py http://www.tibsnjoan.co.uk/reST/test.py - I've added detection of globals that are declared and used below the top level. For instance (hope this doesn't wrap): U:\dps>python dps_visit.py show test.py Parsing file test.py Locating attribute docstrings Module test (in file test.py) """A simple test file for input to ast-mining.py. """ Import string From string import lstrip, rstrip Attributes one """Documentation after `one` (intervening blank line) """ two six """Documentation after ``six=[four,five]`` """ gmodule """Global at the module level """ three five four Class Fred """Class at the module level. """ Method __init__(self) """Initialisation for `Fred` """ Attributes b """`self.b` within `Fred.__init__()` """ Class Insider """Class defined inside `Fred.__init__()` """ Method fred(self) Function fredinner(()) Class Jim(Fred) Function func(a, b=1, c='jim', d=None, e=List(())) """Function at the module level """ Class InFunc Function infunc(()) """Function defined inside function `func()` """ Class Silly Function silly_fn(()) Globals defined *and used* below the top level: Global gagain used in Method '__init__' in Class 'Fred' and in Function 'fredinner' in Method 'fred' Global gclass used in Class 'Fred' in Module 'test' Global gclass2 used in Class 'Insider' in Method '__init__' Global gfunc used in Function 'func' in Module 'test' Global gfunc2 used in Method 'fred' in Class 'Insider' Global ginner used in Function 'infunc' in Function 'func' Global ginner2 used in Function 'fredinner' in Method 'fred' Global gmeth used in Method '__init__' in Class 'Fred' U:\dps> Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Give a pedant an inch and they'll take 25.4mm (once they've established you're talking a post-1959 inch, of course) My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) |