# HG changeset patch # User Jeff Hammel # Date 1272659390 25200 # Node ID 08f79ed6cfa37986740ed2cd70f2135076617a02 # Parent 40495047117d8a5e489fd7cc9f288b78ae78a2a6 move the one utility function directly into the main file so that it may be directly invoked on the web diff -r 40495047117d -r 08f79ed6cfa3 stampit/main.py --- a/stampit/main.py Fri Apr 30 13:26:51 2010 -0700 +++ b/stampit/main.py Fri Apr 30 13:29:50 2010 -0700 @@ -17,7 +17,12 @@ import tempfile from optparse import OptionParser, IndentedHelpFormatter, HelpFormatter -from utils import which + +def which(executable): + for directory in os.environ['PATH'].split(os.pathsep): + path = os.path.join(directory, executable) + if os.path.exists(path): + return path def call(*args, **kwargs): code = subprocess.call(*args, **kwargs) diff -r 40495047117d -r 08f79ed6cfa3 stampit/utils.py --- a/stampit/utils.py Fri Apr 30 13:26:51 2010 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -""" -utility functions -""" - -import os - -def which(executable): - for directory in os.environ['PATH'].split(os.pathsep): - path = os.path.join(directory, executable) - if os.path.exists(path): - return path - -