# HG changeset patch # User Paul Boddie # Date 1225064685 -3600 # Node ID c862266f216bbba71b5d2b8b66ace1db28469058 # Parent 31cef282d0b9f5d7cd67545c9d52efb702e419ad Renamed the package consistently to python-astgrep. Made the installation use setup.py. Added other documentation and Python-related files. diff -r 31cef282d0b9 -r c862266f216b PKG-INFO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PKG-INFO Mon Oct 27 00:44:45 2008 +0100 @@ -0,0 +1,20 @@ +Metadata-Version: 1.1 +Name: astgrep +Version: 0.1 +Author: Paul Boddie +Author-email: paul at boddie org uk +Maintainer: Paul Boddie +Maintainer-email: paul at boddie org uk +Home-page: http://www.boddie.org.uk/python/astgrep.html +Download-url: http://www.boddie.org.uk/python/downloads/astgrep-0.1.tar.gz +Summary: Search Python abstract syntax trees for nodes of a particular type having a particular textual value. +License: GPL (version 3 or later) +Description: Search through Python source files for textual information + of a specific type. Instead of matching a search term or expression to + all text in a program, as grep would do, astgrep matches only tokens + in the program having a particular type, such as names or constants. +Keywords: grep AST compiler compiler.ast +Requires: CMDsyntax +Classifier: Development Status :: 3 - Alpha +Classifier: License :: OSI Approved :: GNU General Public License (GPL) +Classifier: Programming Language :: Python diff -r 31cef282d0b9 -r c862266f216b README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.txt Mon Oct 27 00:44:45 2008 +0100 @@ -0,0 +1,88 @@ +Introduction +------------ + +The astgrep program permits the searching of Python source files for textual +information of a specific type. Instead of matching a search term or +expression to all text in a program, as grep would do, astgrep matches only +tokens in the program having a particular type, such as names or constants. + +Quick Start +----------- + +Try the following examples, replacing astgrep with astgrep.py if the software +has not been installed from a package: + +Search for classes whose name contains Node in a particular file: + + astgrep -t Class -e Node libxml2dom/__init__.py + +Search for functions or methods whose name starts with visit in a particular +directory hierarchy, micropython, showing the name of the matching functions +in the output: + + astgrep -p -t Function -e '^visit' -r micropython + +Search for accesses of attributes having the exact name _node in a particular +directory hierarchy, libxml2dom, showing the line number of each match in the +output: + + astgrep -n -t Getattr -e '^_node$' -r libxml2dom + +Dependencies +------------ + +The astgrep program has the following basic dependencies: + +Package Release Information +------- ------------------- + +Python 2.5.1 +cmdsyntax Tested with 0.91 + +URLs +---- + +Python http://www.python.org/ +CMDsyntax http://www.boddie.org.uk/david/Projects/Python/CMDSyntax/index.html + +Contact, Copyright and Licence Information +------------------------------------------ + +The current Web page for astgrep at the time of release is: + +http://www.boddie.org.uk/python/astgrep.html + +Copyright and licence information can be found in the docs directory - see +docs/COPYING.txt and docs/gpl-3.0.txt for more information. + +Release Procedures +------------------ + +Update the astgrep.py __version__ attributes. +Change the version number and package filename/directory in the documentation. +Update the release notes (see above). +Check the setup.py file (if eventually written). +Check the release information in the PKG-INFO file and in the package +changelog (and other files). +Tag, export. +Generate the resources (for the non-packaged full version). +Remove generated .pyc files: rm `find . -name "*.pyc"` +Archive, upload. + +Making Packages +--------------- + +To make Debian-based packages: + + 1. Create new package directories under packages if necessary. + 2. Make a symbolic link in the distribution's root directory to keep the + Debian tools happy. Try one of the following: + + ln -s packages/ubuntu-gutsy/astgrep/debian/ + + 3. Run the package builder: + + dpkg-buildpackage -rfakeroot + + 4. Locate and tidy up the packages in the parent directory of the + distribution's root directory. diff -r 31cef282d0b9 -r c862266f216b astgrep.py --- a/astgrep.py Mon Oct 27 00:21:56 2008 +0100 +++ b/astgrep.py Mon Oct 27 00:44:45 2008 +0100 @@ -23,6 +23,8 @@ import compiler import os +__version__ = "0.1" + def search_recursive(directory, term_type, term, op=None): """ diff -r 31cef282d0b9 -r c862266f216b packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install --- a/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install Mon Oct 27 00:21:56 2008 +0100 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install Mon Oct 27 00:44:45 2008 +0100 @@ -1,2 +1,1 @@ -astgrep.py usr/lib/astgrep/bin/ scripts/astgrep usr/bin/ diff -r 31cef282d0b9 -r c862266f216b packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst --- a/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst Mon Oct 27 00:21:56 2008 +0100 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst Mon Oct 27 00:44:45 2008 +0100 @@ -1,5 +1,5 @@ #! /bin/sh -# postinst script for astgrep +# postinst script for python-astgrep # # see: dh_installdeb(1) @@ -23,11 +23,11 @@ # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. -PACKAGE=astgrep +PACKAGE=python-astgrep case "$1" in configure|abort-upgrade|abort-remove|abort-deconfigure) - chmod ugo+rx /usr/lib/astgrep/bin/astgrep.py /usr/bin/astgrep + chmod ugo+rx /usr/bin/astgrep ;; *) diff -r 31cef282d0b9 -r c862266f216b packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm --- a/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm Mon Oct 27 00:21:56 2008 +0100 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm Mon Oct 27 00:44:45 2008 +0100 @@ -1,9 +1,9 @@ #! /bin/sh -# prerm script for astgrep +# prerm script for python-astgrep set -e -PACKAGE=astgrep +PACKAGE=python-astgrep case "$1" in remove|upgrade|failed-upgrade) diff -r 31cef282d0b9 -r c862266f216b packages/ubuntu-gutsy/python-astgrep/debian/changelog --- a/packages/ubuntu-gutsy/python-astgrep/debian/changelog Mon Oct 27 00:21:56 2008 +0100 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/changelog Mon Oct 27 00:44:45 2008 +0100 @@ -1,4 +1,4 @@ -astgrep (0.1-0ubuntu1) gutsy; urgency=low +python-astgrep (0.1-0ubuntu1) gutsy; urgency=low * Packaging of upstream sources. diff -r 31cef282d0b9 -r c862266f216b packages/ubuntu-gutsy/python-astgrep/debian/control --- a/packages/ubuntu-gutsy/python-astgrep/debian/control Mon Oct 27 00:21:56 2008 +0100 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/control Mon Oct 27 00:44:45 2008 +0100 @@ -1,4 +1,4 @@ -Source: astgrep +Source: python-astgrep Section: python Priority: optional Maintainer: Paul Boddie @@ -6,7 +6,7 @@ XS-Python-Version: all Standards-Version: 3.7.2.1 -Package: astgrep +Package: python-astgrep Architecture: all Depends: ${python:Depends}, python-cmdsyntax (>= 0.91-0ubuntu2) XB-Python-Version: ${python:Versions} diff -r 31cef282d0b9 -r c862266f216b packages/ubuntu-gutsy/python-astgrep/debian/rules --- a/packages/ubuntu-gutsy/python-astgrep/debian/rules Mon Oct 27 00:21:56 2008 +0100 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/rules Mon Oct 27 00:44:45 2008 +0100 @@ -11,12 +11,12 @@ touch $@ build-python%: - #python$* setup.py build_py - #touch $@ + python$* setup.py build_py + touch $@ build-python-scripts: - #python setup.py build_scripts - #touch $@ + python setup.py build_scripts + touch $@ clean: dh_testdir @@ -35,10 +35,10 @@ dh_clean -k install-python%: - #python$* setup.py install_lib --install-dir $(CURDIR)/debian/python-desktop/usr/lib/python$*/site-packages + python$* setup.py install_lib --install-dir $(CURDIR)/debian/python-astgrep/usr/lib/python$*/site-packages install-python-scripts: - #python setup.py install_scripts --install-dir $(CURDIR)/debian/python-desktop/usr/bin + python setup.py install_scripts --install-dir $(CURDIR)/debian/python-astgrep/usr/bin # Build architecture-independent files here. diff -r 31cef282d0b9 -r c862266f216b scripts/astgrep --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/astgrep Mon Oct 27 00:44:45 2008 +0100 @@ -0,0 +1,3 @@ +#!/bin/sh + +python -m astgrep $* diff -r 31cef282d0b9 -r c862266f216b setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Mon Oct 27 00:44:45 2008 +0100 @@ -0,0 +1,16 @@ +#! /usr/bin/env python + +from distutils.core import setup + +import astgrep + +setup( + name = "astgrep", + description = "Search Python abstract syntax trees for nodes of a particular type having a particular textual value", + author = "Paul Boddie", + author_email = "paul@boddie.org.uk", + url = "http://www.boddie.org.uk/python/astgrep.html", + version = astgrep.__version__, + py_modules = ["astgrep"], + scripts = ["astgrep.py"] + )