changeset 14:08f79ed6cfa3 default tip

move the one utility function directly into the main file so that it may be directly invoked on the web
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 30 Apr 2010 13:29:50 -0700
parents 40495047117d
children
files stampit/main.py stampit/utils.py
diffstat 2 files changed, 6 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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
-
-