head	1.2;
access;
symbols
	gentoo_1_0_rc5:1.1;
locks; strict;
comment	@# @;


1.2
date	2002.01.29.01.11.26;	author drobbins;	state dead;
branches;
next	1.1;

1.1
date	2001.04.06.03.07.36;	author drobbins;	state Exp;
branches;
next	;


desc
@@


1.2
log
@removing a bunch of my Web junk from Portage
@
text
@#!/usr/bin/env python

# pytext 2.1
# Copyright 1999-2000 Daniel Robbins
# Distributed under the GPL

import sys

def runfile(myarg):
	"interprets a text file with embedded elements"
	mylocals={}
	try:
		a=open(myarg,'r')
	except IOError:
		sys.stderr.write("!!! Error opening "+myarg+"!\n")
		return
	mylines=a.readlines()
	a.close()
	pos=0
	while pos<len(mylines):
		if mylines[pos][0:8]=="<!--code":
			mycode=""
			pos=pos+1
			while (pos<len(mylines)) and (mylines[pos][0:3]!="-->"):
				mycode=mycode+mylines[pos]
				pos=pos+1
			exec(mycode,globals(),mylocals)
		else:
			sys.stdout.write(mylines[pos])
		pos=pos+1

if len(sys.argv)>1:
	for x in sys.argv[1:]:
		runfile(x)
	sys.exit(0)
else:
	sys.stderr.write("pytext 2.1 -- Copyright 1999-2000 Daniel Robbins. Distributed under the\nGNU Public License\n\nUsage: "+sys.argv[0]+" file0 [file1]...\n")
	sys.exit(1)
@


1.1
log
@new ebuild
@
text
@@

