1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/PKG-INFO Mon Oct 27 00:44:45 2008 +0100
1.3 @@ -0,0 +1,20 @@
1.4 +Metadata-Version: 1.1
1.5 +Name: astgrep
1.6 +Version: 0.1
1.7 +Author: Paul Boddie
1.8 +Author-email: paul at boddie org uk
1.9 +Maintainer: Paul Boddie
1.10 +Maintainer-email: paul at boddie org uk
1.11 +Home-page: http://www.boddie.org.uk/python/astgrep.html
1.12 +Download-url: http://www.boddie.org.uk/python/downloads/astgrep-0.1.tar.gz
1.13 +Summary: Search Python abstract syntax trees for nodes of a particular type having a particular textual value.
1.14 +License: GPL (version 3 or later)
1.15 +Description: Search through Python source files for textual information
1.16 + of a specific type. Instead of matching a search term or expression to
1.17 + all text in a program, as grep would do, astgrep matches only tokens
1.18 + in the program having a particular type, such as names or constants.
1.19 +Keywords: grep AST compiler compiler.ast
1.20 +Requires: CMDsyntax
1.21 +Classifier: Development Status :: 3 - Alpha
1.22 +Classifier: License :: OSI Approved :: GNU General Public License (GPL)
1.23 +Classifier: Programming Language :: Python
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/README.txt Mon Oct 27 00:44:45 2008 +0100
2.3 @@ -0,0 +1,88 @@
2.4 +Introduction
2.5 +------------
2.6 +
2.7 +The astgrep program permits the searching of Python source files for textual
2.8 +information of a specific type. Instead of matching a search term or
2.9 +expression to all text in a program, as grep would do, astgrep matches only
2.10 +tokens in the program having a particular type, such as names or constants.
2.11 +
2.12 +Quick Start
2.13 +-----------
2.14 +
2.15 +Try the following examples, replacing astgrep with astgrep.py if the software
2.16 +has not been installed from a package:
2.17 +
2.18 +Search for classes whose name contains Node in a particular file:
2.19 +
2.20 + astgrep -t Class -e Node libxml2dom/__init__.py
2.21 +
2.22 +Search for functions or methods whose name starts with visit in a particular
2.23 +directory hierarchy, micropython, showing the name of the matching functions
2.24 +in the output:
2.25 +
2.26 + astgrep -p -t Function -e '^visit' -r micropython
2.27 +
2.28 +Search for accesses of attributes having the exact name _node in a particular
2.29 +directory hierarchy, libxml2dom, showing the line number of each match in the
2.30 +output:
2.31 +
2.32 + astgrep -n -t Getattr -e '^_node$' -r libxml2dom
2.33 +
2.34 +Dependencies
2.35 +------------
2.36 +
2.37 +The astgrep program has the following basic dependencies:
2.38 +
2.39 +Package Release Information
2.40 +------- -------------------
2.41 +
2.42 +Python 2.5.1
2.43 +cmdsyntax Tested with 0.91
2.44 +
2.45 +URLs
2.46 +----
2.47 +
2.48 +Python http://www.python.org/
2.49 +CMDsyntax http://www.boddie.org.uk/david/Projects/Python/CMDSyntax/index.html
2.50 +
2.51 +Contact, Copyright and Licence Information
2.52 +------------------------------------------
2.53 +
2.54 +The current Web page for astgrep at the time of release is:
2.55 +
2.56 +http://www.boddie.org.uk/python/astgrep.html
2.57 +
2.58 +Copyright and licence information can be found in the docs directory - see
2.59 +docs/COPYING.txt and docs/gpl-3.0.txt for more information.
2.60 +
2.61 +Release Procedures
2.62 +------------------
2.63 +
2.64 +Update the astgrep.py __version__ attributes.
2.65 +Change the version number and package filename/directory in the documentation.
2.66 +Update the release notes (see above).
2.67 +Check the setup.py file (if eventually written).
2.68 +Check the release information in the PKG-INFO file and in the package
2.69 +changelog (and other files).
2.70 +Tag, export.
2.71 +Generate the resources (for the non-packaged full version).
2.72 +Remove generated .pyc files: rm `find . -name "*.pyc"`
2.73 +Archive, upload.
2.74 +
2.75 +Making Packages
2.76 +---------------
2.77 +
2.78 +To make Debian-based packages:
2.79 +
2.80 + 1. Create new package directories under packages if necessary.
2.81 + 2. Make a symbolic link in the distribution's root directory to keep the
2.82 + Debian tools happy. Try one of the following:
2.83 +
2.84 + ln -s packages/ubuntu-gutsy/astgrep/debian/
2.85 +
2.86 + 3. Run the package builder:
2.87 +
2.88 + dpkg-buildpackage -rfakeroot
2.89 +
2.90 + 4. Locate and tidy up the packages in the parent directory of the
2.91 + distribution's root directory.
3.1 --- a/astgrep.py Mon Oct 27 00:21:56 2008 +0100
3.2 +++ b/astgrep.py Mon Oct 27 00:44:45 2008 +0100
3.3 @@ -23,6 +23,8 @@
3.4 import compiler
3.5 import os
3.6
3.7 +__version__ = "0.1"
3.8 +
3.9 def search_recursive(directory, term_type, term, op=None):
3.10
3.11 """
4.1 --- a/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install Mon Oct 27 00:21:56 2008 +0100
4.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install Mon Oct 27 00:44:45 2008 +0100
4.3 @@ -1,2 +1,1 @@
4.4 -astgrep.py usr/lib/astgrep/bin/
4.5 scripts/astgrep usr/bin/
5.1 --- a/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst Mon Oct 27 00:21:56 2008 +0100
5.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst Mon Oct 27 00:44:45 2008 +0100
5.3 @@ -1,5 +1,5 @@
5.4 #! /bin/sh
5.5 -# postinst script for astgrep
5.6 +# postinst script for python-astgrep
5.7 #
5.8 # see: dh_installdeb(1)
5.9
5.10 @@ -23,11 +23,11 @@
5.11 # installation fails and the `postinst' is called with `abort-upgrade',
5.12 # `abort-remove' or `abort-deconfigure'.
5.13
5.14 -PACKAGE=astgrep
5.15 +PACKAGE=python-astgrep
5.16
5.17 case "$1" in
5.18 configure|abort-upgrade|abort-remove|abort-deconfigure)
5.19 - chmod ugo+rx /usr/lib/astgrep/bin/astgrep.py /usr/bin/astgrep
5.20 + chmod ugo+rx /usr/bin/astgrep
5.21 ;;
5.22
5.23 *)
6.1 --- a/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm Mon Oct 27 00:21:56 2008 +0100
6.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm Mon Oct 27 00:44:45 2008 +0100
6.3 @@ -1,9 +1,9 @@
6.4 #! /bin/sh
6.5 -# prerm script for astgrep
6.6 +# prerm script for python-astgrep
6.7
6.8 set -e
6.9
6.10 -PACKAGE=astgrep
6.11 +PACKAGE=python-astgrep
6.12
6.13 case "$1" in
6.14 remove|upgrade|failed-upgrade)
7.1 --- a/packages/ubuntu-gutsy/python-astgrep/debian/changelog Mon Oct 27 00:21:56 2008 +0100
7.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/changelog Mon Oct 27 00:44:45 2008 +0100
7.3 @@ -1,4 +1,4 @@
7.4 -astgrep (0.1-0ubuntu1) gutsy; urgency=low
7.5 +python-astgrep (0.1-0ubuntu1) gutsy; urgency=low
7.6
7.7 * Packaging of upstream sources.
7.8
8.1 --- a/packages/ubuntu-gutsy/python-astgrep/debian/control Mon Oct 27 00:21:56 2008 +0100
8.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/control Mon Oct 27 00:44:45 2008 +0100
8.3 @@ -1,4 +1,4 @@
8.4 -Source: astgrep
8.5 +Source: python-astgrep
8.6 Section: python
8.7 Priority: optional
8.8 Maintainer: Paul Boddie <paul@boddie.org.uk>
8.9 @@ -6,7 +6,7 @@
8.10 XS-Python-Version: all
8.11 Standards-Version: 3.7.2.1
8.12
8.13 -Package: astgrep
8.14 +Package: python-astgrep
8.15 Architecture: all
8.16 Depends: ${python:Depends}, python-cmdsyntax (>= 0.91-0ubuntu2)
8.17 XB-Python-Version: ${python:Versions}
9.1 --- a/packages/ubuntu-gutsy/python-astgrep/debian/rules Mon Oct 27 00:21:56 2008 +0100
9.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/rules Mon Oct 27 00:44:45 2008 +0100
9.3 @@ -11,12 +11,12 @@
9.4 touch $@
9.5
9.6 build-python%:
9.7 - #python$* setup.py build_py
9.8 - #touch $@
9.9 + python$* setup.py build_py
9.10 + touch $@
9.11
9.12 build-python-scripts:
9.13 - #python setup.py build_scripts
9.14 - #touch $@
9.15 + python setup.py build_scripts
9.16 + touch $@
9.17
9.18 clean:
9.19 dh_testdir
9.20 @@ -35,10 +35,10 @@
9.21 dh_clean -k
9.22
9.23 install-python%:
9.24 - #python$* setup.py install_lib --install-dir $(CURDIR)/debian/python-desktop/usr/lib/python$*/site-packages
9.25 + python$* setup.py install_lib --install-dir $(CURDIR)/debian/python-astgrep/usr/lib/python$*/site-packages
9.26
9.27 install-python-scripts:
9.28 - #python setup.py install_scripts --install-dir $(CURDIR)/debian/python-desktop/usr/bin
9.29 + python setup.py install_scripts --install-dir $(CURDIR)/debian/python-astgrep/usr/bin
9.30
9.31 # Build architecture-independent files here.
9.32
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/scripts/astgrep Mon Oct 27 00:44:45 2008 +0100
10.3 @@ -0,0 +1,3 @@
10.4 +#!/bin/sh
10.5 +
10.6 +python -m astgrep $*
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/setup.py Mon Oct 27 00:44:45 2008 +0100
11.3 @@ -0,0 +1,16 @@
11.4 +#! /usr/bin/env python
11.5 +
11.6 +from distutils.core import setup
11.7 +
11.8 +import astgrep
11.9 +
11.10 +setup(
11.11 + name = "astgrep",
11.12 + description = "Search Python abstract syntax trees for nodes of a particular type having a particular textual value",
11.13 + author = "Paul Boddie",
11.14 + author_email = "paul@boddie.org.uk",
11.15 + url = "http://www.boddie.org.uk/python/astgrep.html",
11.16 + version = astgrep.__version__,
11.17 + py_modules = ["astgrep"],
11.18 + scripts = ["astgrep.py"]
11.19 + )