diff options
Diffstat (limited to 'sandbox/davidg')
| -rw-r--r-- | sandbox/davidg/infrastructure/cvs-reorg.sh | 119 | ||||
| -rwxr-xr-x | sandbox/davidg/infrastructure/docutils-update | 227 | ||||
| -rw-r--r-- | sandbox/davidg/pysource_reader/en.py | 31 | ||||
| -rw-r--r-- | sandbox/davidg/pysource_reader/nodes.py | 98 |
4 files changed, 0 insertions, 475 deletions
diff --git a/sandbox/davidg/infrastructure/cvs-reorg.sh b/sandbox/davidg/infrastructure/cvs-reorg.sh deleted file mode 100644 index c2bb56aca..000000000 --- a/sandbox/davidg/infrastructure/cvs-reorg.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# $Id$ -# CVS reorganization script for Docutils (docutils.sf.net). -# By Felix Wiemann and David Goodger -# Implemented on 2004-06-02; see -# <http://docutils.sf.net/HISTORY.html#documentation-cleanup-reorganization>. - -# Paths should be absolute (implied by -# http://sf.net/docman/display_doc.php?docid=768&group_id=1#repositoryrestructure). - -# Exit on error. -set -e - -############################################################ - -echo -echo 'Remove module & files added by mistake...' - -rm -rfv /cvsroot/docutils/modulename # duplicate of sandbox module -rm -rfv /cvsroot/docutils/docutils/Attic # duplicates of CVSROOT files -rm -rfv /cvsroot/docutils/docutils/CVSROOT # another duplicate - -############################################################ - -echo -echo 'Create new empty directory structure...' - -# introductory/tutorial material for end-users -mkdir -v /cvsroot/docutils/docutils/docs/user/ - -# for core-developers -mkdir -v /cvsroot/docutils/docutils/docs/dev/ -mkdir -v /cvsroot/docutils/docutils/docs/dev/rst/ - -# reference material for all groups -mkdir -v /cvsroot/docutils/docutils/docs/ref/ -mkdir -v /cvsroot/docutils/docutils/docs/ref/rst/ - -# Python Enhancement Proposals -mkdir -v /cvsroot/docutils/docutils/docs/peps/ - -############################################################ - -echo -echo 'Move entire subdirectories...' - -mv -iv /cvsroot/docutils/docutils/docs/rst \ - /cvsroot/docutils/docutils/docs/user/rst - -# for component-developers and core-developers -mv -iv /cvsroot/docutils/docutils/spec/howto \ - /cvsroot/docutils/docutils/docs/howto - -############################################################ - -echo -echo 'Move (& rename) individual files...' - -# All file names have to end with ",v"; this is the CVS repository! - -mv -iv /cvsroot/docutils/docutils/docs/config.txt,v \ - /cvsroot/docutils/docutils/docs/user/ -mv -iv /cvsroot/docutils/docutils/docs/latex.txt,v \ - /cvsroot/docutils/docutils/docs/user/ -mv -iv /cvsroot/docutils/docutils/docs/tools.txt,v \ - /cvsroot/docutils/docutils/docs/user/ - -mv -iv /cvsroot/docutils/docutils/spec/pysource.dtd,v \ - /cvsroot/docutils/docutils/docs/dev/ -mv -iv /cvsroot/docutils/docutils/spec/pysource.txt,v \ - /cvsroot/docutils/docutils/docs/dev/ -mv -iv /cvsroot/docutils/docutils/spec/semantics.txt,v \ - /cvsroot/docutils/docutils/docs/dev/ -mv -iv /cvsroot/docutils/docutils/spec/notes.txt,v \ - /cvsroot/docutils/docutils/docs/dev/todo.txt,v # rename - -mv -iv /cvsroot/docutils/docutils/spec/doctree.txt,v \ - /cvsroot/docutils/docutils/docs/ref/ -mv -iv /cvsroot/docutils/docutils/spec/docutils.dtd,v \ - /cvsroot/docutils/docutils/docs/ref/ -mv -iv /cvsroot/docutils/docutils/spec/soextblx.dtd,v \ - /cvsroot/docutils/docutils/docs/ref/ - -mv -iv /cvsroot/docutils/docutils/spec/transforms.txt,v \ - /cvsroot/docutils/docutils/docs/ref/ - -mv -iv /cvsroot/docutils/docutils/spec/rst/alternatives.txt,v \ - /cvsroot/docutils/docutils/docs/dev/rst/ -mv -iv /cvsroot/docutils/docutils/spec/rst/problems.txt,v \ - /cvsroot/docutils/docutils/docs/dev/rst/ - -mv -iv /cvsroot/docutils/docutils/spec/rst/reStructuredText.txt,v \ - /cvsroot/docutils/docutils/docs/ref/rst/restructuredtext.txt,v # rename -mv -iv /cvsroot/docutils/docutils/spec/rst/directives.txt,v \ - /cvsroot/docutils/docutils/docs/ref/rst/ -mv -iv /cvsroot/docutils/docutils/spec/rst/interpreted.txt,v \ - /cvsroot/docutils/docutils/docs/ref/rst/roles.txt,v # rename -mv -iv /cvsroot/docutils/docutils/spec/rst/introduction.txt,v \ - /cvsroot/docutils/docutils/docs/ref/rst/ - -mv -iv /cvsroot/docutils/docutils/spec/pep-????.txt,v \ - /cvsroot/docutils/docutils/docs/peps/ - -############################################################ - -echo -echo 'Remove old, unused, empty directories...' - -# nothing interesting in here -rm -rfv /cvsroot/docutils/docutils/spec/Attic - -# empty -rmdir -v /cvsroot/docutils/docutils/spec/rst -rmdir -v /cvsroot/docutils/docutils/spec - -############################################################ - -echo -echo Finished. diff --git a/sandbox/davidg/infrastructure/docutils-update b/sandbox/davidg/infrastructure/docutils-update deleted file mode 100755 index 0b60fcbd1..000000000 --- a/sandbox/davidg/infrastructure/docutils-update +++ /dev/null @@ -1,227 +0,0 @@ -#! /bin/bash -# $Id$ -# -# This script is installed as a cron job to automatically update the -# Docutils web site whenever the SVN files change. Any .html document -# with a corresponding .txt file is regenerated whenever the .txt -# changes. -# -# Options: -# -f Do not give feedback. -# -t Run the script in trace mode ("set -o xtrace"). -# -u Regenerate .html unconditionally. -# -v Run verbosely. -# -# Prerequisites: -# -# - Checked out trunk at $snapshotdir. -# - Checked out main tree at $lib. - -# exit on error -set -e - -# make all newly created files group writeable -umask 002 - -basedir=/home/groups/docutils/htdocs -project=docutils -# $auxdir is non-public. -auxdir=$basedir/aux -# $htdocsdest is the destination for htdocs and will be moved to -# another server later; so we keep it non-public (under $auxdir). -htdocsdest=$auxdir/htdocs -# Where to create the snapshots (non-public). -snapshotdir=$auxdir/snapshots -# Where to publish the snapshots (public). -snapshotdest=/home/groups/ftp/pub/docutils -bindir=$auxdir/bin -htdocs_patchfile=$auxdir/htdocs.patch -htdocs_tarball=$auxdir/htdocs.tar -htdocs_new_tarball=$auxdir/htdocs.new.tar -# htdocs directory on SF.net -remotehtdocs=/home/groups/d/do/docutils/htdocs -pylib=$auxdir/lib/python -lib=$pylib/$project -# Lock directory. -lockdir=$auxdir/lock -# SSH stuff. -sshdir=$auxdir/.ssh -sshhost=docutilsupdate@shell.sourceforge.net -sshcommand="ssh -i $lockdir/id_dsa - -o UserKnownHostsFile=$sshdir/known_hosts $sshhost" - -export PYTHONPATH=$pylib:$lib:$lib/extras - -trace=0 -unconditional=0 -verbose=0 -feedback=1 - -while getopts ftuv opt -do - case $opt in - f) feedback=;; - t) trace=1;; - u) unconditional=1;; - v) verbose=1;; - \?) exit 2;; - esac -done -shift `expr $OPTIND - 1` - -test $feedback && echo 'Starting docutils-update run...' || true - -if [ $trace -eq 1 -o $verbose -eq 1 ] ; then - set -o xtrace -fi - -# Acquire lock. -if ! mkdir $lockdir; then - echo - echo Could not create lock directory at - echo $lockdir - echo - echo Please ensure no other user is running this script - echo and delete the directory. - exit 1 -fi -# Always clean up on exit. -trap "rm -rf $lockdir; trap - 0; exit 1" 0 1 2 3 15 -# Make sure the lock directory is deletable (i.e. rwx) by other group -# members (in case this script crashes after copying files into the -# directory) and un-readable by world (because we'll be storing the -# key in it). -chmod 0770 $lockdir - - -# update library area -cd $lib -svn up --quiet - -# -------------------- Snapshots: -------------------- - -# gather the materials -cd $snapshotdir -svn up --quiet - -# Ensure proper directory permissions are set so that the files can be -# modified by several users. Changing permissions of files is -# probably not necessary because files can be deleted and re-created. -# Do not change permissions of aux directory to keep it non-public -# (but change permissions for all subdirectories). -#find $basedir -type f -print0 | xargs -0 chmod ug+rw 2> /dev/null || true -find $basedir -name aux -o -type d -print0 | xargs -0 chmod ug+rwxs 2> /dev/null || true - -# create the snapshots -exclude='--exclude=.svn' -tar -cz $exclude -f $project-snapshot.tgz $project -tar -cz $exclude -f $project-sandbox-snapshot.tgz sandbox -tar -cz $exclude -f $project-web-snapshot.tgz web -( cd sandbox/gschwant ; - tar -cz $exclude -f ../../docfactory-snapshot.tgz docfactory ) - -# plant the snapshots -mv -f *snapshot.tgz $snapshotdest - -# -------------------- htdocs: -------------------- - -cd $snapshotdir - -function copy_to_htdocsdest() { - find "$@" -type d -name .svn -prune -o -type f -print0 | \ - xargs -0 cp --update --parents --target-directory=$htdocsdest -} - -# update htdocs -copy_to_htdocsdest sandbox -(cd $project; copy_to_htdocsdest *) -(cd web; copy_to_htdocsdest * .[^.]*) - -# update HTML docs -cd $htdocsdest/tools - -if [ $trace -eq 0 ] ; then - set +o xtrace -fi - -for htmlfile in `find .. -name '*.html'` ; do - dir=`dirname $htmlfile` - base=`basename $htmlfile .html` - txtfile=$dir/$base.txt - if [ -e $txtfile ] ; then - if [ $unconditional -eq 1 -o $txtfile -nt $htmlfile ] ; then - if [ "${base:0:4}" == "pep-" ] ; then - test $feedback && echo "$txtfile (PEP)" || true - python $lib/tools/pep.py --config=$dir/docutils.conf $txtfile $htmlfile - else - test $feedback && echo $txtfile || true - python $lib/tools/rst2html.py --config=$dir/docutils.conf $txtfile $htmlfile - fi - fi - fi -done - -# -------------------- Push changes to remote server. -------------------- - -# SSH doesn't want to read id_dsa files which don't have 0600 -# permissions. This is getting into our way here, but we work around -# this by copying id_dsa to $lockdir/id_dsa and setting the -# permissions of the resulting id_dsa file to 0600. - -# Copy the key. -cp $sshdir/id_dsa $lockdir/id_dsa -# SSH wants this. -chmod 0600 $lockdir/id_dsa - -rm -f $htdocs_patchfile -# Create new tarball. -cd $htdocsdest -tar cf $htdocs_new_tarball . - -# If there is no old tarball, we have to transmit the whole tarball. -if test ! -f $htdocs_tarball; then - test $feedback && echo Transmitting entire tarball. || true - gzip -c $htdocs_new_tarball | $sshcommand \ - " - set -e - umask 002 - gunzip -c > ~/htdocs.tar - cd $remotehtdocs - tar xmf ~/htdocs.tar - " -# If the current and the new tarball differ, transmit patch file. -elif ! diff -q $htdocs_tarball $htdocs_new_tarball > /dev/null; then - # Create patch. - $bindir/bsdiff $htdocs_tarball $htdocs_new_tarball $htdocs_patchfile - test $feedback && echo Patch size: `du -h $htdocs_patchfile | sed 's/\t.*//'` || true - # Delete current tarball. If something goes wrong with uploading - # and applying the patch file, docutils-update will notice that - # the tarball isn't present at the next run and transfer the whole - # tarball, because we're left in an undefined state (the servers - # are out of sync). - rm -f $htdocs_tarball - # Upload patch file. - $sshcommand \ - " - set -e - umask 002 - cat > ~/htdocs.patch - ~/bin/bspatch ~/htdocs.tar ~/htdocs.new.tar ~/htdocs.patch - cd $remotehtdocs - tar xmf ~/htdocs.new.tar - mv ~/htdocs.new.tar ~/htdocs.tar - rm -f ~/htdocs.patch - " \ - < $htdocs_patchfile -fi -mv $htdocs_new_tarball $htdocs_tarball - -# Tidy up. -rm -f $htdocs_patchfile -trap - 0 1 2 3 15 -rm -rf $lockdir -test $feedback && echo '...docutils-update done.' || true - -# Local Variables: -# indent-tabs-mode: nil -# End: diff --git a/sandbox/davidg/pysource_reader/en.py b/sandbox/davidg/pysource_reader/en.py deleted file mode 100644 index 78a383ab3..000000000 --- a/sandbox/davidg/pysource_reader/en.py +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/bin/env python - -""" -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -""" - -interpreted = { - 'package': nodes.package, - 'module': nodes.module, - 'class': nodes.inline_class, - 'method': nodes.method, - 'function': nodes.function, - 'variable': nodes.variable, - 'parameter': nodes.parameter, - 'type': nodes.type, - 'class attribute': nodes.class_attribute, - 'classatt': nodes.class_attribute, - 'instance attribute': nodes.instance_attribute, - 'instanceatt': nodes.instance_attribute, - 'module attribute': nodes.module_attribute, - 'moduleatt': nodes.module_attribute, - 'exception class': nodes.exception_class, - 'exception': nodes.exception_class, - 'warning class': nodes.warning_class, - 'warning': nodes.warning_class,} -"""Mapping of interpreted text role name to nodes.py class.""" diff --git a/sandbox/davidg/pysource_reader/nodes.py b/sandbox/davidg/pysource_reader/nodes.py deleted file mode 100644 index 6aae3bdb6..000000000 --- a/sandbox/davidg/pysource_reader/nodes.py +++ /dev/null @@ -1,98 +0,0 @@ -#! /usr/bin/env python - -""" -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Revision: $Revision$ -:Date: $Date$ -:Copyright: This module has been placed in the public domain. - -""" - -from dps import nodes -from dps.nodes import Element, TextElement, Structural, Component, Inline - - -# ===================== -# Structural Elements -# ===================== - -class package_section(Structural, Element): pass -class module_section(Structural, Element): pass -class class_section(Structural, Element): pass -class method_section(Structural, Element): pass -class function_section(Structural, Element): pass -class module_attribute_section(Structural, Element): pass -class class_attribute_section(Structural, Element): pass -class instance_attribute_section(Structural, Element): pass - -# Structural Support Elements -# --------------------------- - -class inheritance_list(Component, Element): pass -class parameter_list(Component, Element): pass -class parameter_item(Component, Element): pass -class optional_parameters(Component, Element): pass -class parameter_tuple(Component, Element): pass -class parameter_default(Component, TextElement): pass -class initial_value(Component, TextElement): pass - - -# ================= -# Inline Elements -# ================= - -class package(Component, Inline, TextElement): pass -class module(Component, Inline, TextElement): pass - - -class inline_class(Component, Inline, TextElement): - - tagname = 'class' - - -class method(Component, Inline, TextElement): pass -class function(Component, Inline, TextElement): pass -class variable(Inline, TextElement): pass -class parameter(Component, Inline, TextElement): pass -class type(Inline, TextElement): pass -class class_attribute(Component, Inline, TextElement): pass -class module_attribute(Component, Inline, TextElement): pass -class instance_attribute(Component, Inline, TextElement): pass -class exception_class(Inline, TextElement): pass -class warning_class(Inline, TextElement): pass - - -class SpecificVisitor(nodes.SpecificVisitor): - - """ - """ - - def visit_class_attribute(self, node, ancestry): pass - def visit_class_attribute_section(self, node, ancestry): pass - def visit_class_section(self, node, ancestry): pass - def visit_exception_class(self, node, ancestry): pass - def visit_function(self, node, ancestry): pass - def visit_function_section(self, node, ancestry): pass - def visit_inheritance_list(self, node, ancestry): pass - def visit_initial_value(self, node, ancestry): pass - def visit_inline_class(self, node, ancestry): pass - def visit_instance_attribute(self, node, ancestry): pass - def visit_instance_attribute_section(self, node, ancestry): pass - def visit_method(self, node, ancestry): pass - def visit_method_section(self, node, ancestry): pass - def visit_module(self, node, ancestry): pass - def visit_module_attribute(self, node, ancestry): pass - def visit_module_attribute_section(self, node, ancestry): pass - def visit_module_section(self, node, ancestry): pass - def visit_optional_parameters(self, node, ancestry): pass - def visit_package(self, node, ancestry): pass - def visit_package_section(self, node, ancestry): pass - def visit_parameter(self, node, ancestry): pass - def visit_parameter_default(self, node, ancestry): pass - def visit_parameter_item(self, node, ancestry): pass - def visit_parameter_list(self, node, ancestry): pass - def visit_parameter_tuple(self, node, ancestry): pass - def visit_type(self, node, ancestry): pass - def visit_variable(self, node, ancestry): pass - def visit_warning_class(self, node, ancestry): pass |
