# HG changeset patch # User Jeff Hammel # Date 1324409650 28800 # Node ID 79a43cbdf584019326184525566636977707b444 # Parent 2f45e6ae75fcf265450d3d6fbd3abab5fe39e93a fix unicode stuff diff -r 2f45e6ae75fc -r 79a43cbdf584 clwapp/clwapp.py --- a/clwapp/clwapp.py Fri Feb 26 13:23:52 2010 -0500 +++ b/clwapp/clwapp.py Tue Dec 20 11:34:10 2011 -0800 @@ -15,6 +15,7 @@ """ +import os import subprocess import utils @@ -37,7 +38,7 @@ self.request = Request(environ) res = self.make_response(self.request.method) return res(environ, start_response) - + def make_response(self, method): return self.response_functions.get(method, self.error)() @@ -53,7 +54,8 @@ args = self.command + self.request.GET.keys() process = subprocess.Popen(args, stdout=subprocess.PIPE) output = process.communicate()[0] - title = ' '.join(args) + output = output.decode('utf-8', errors='ignore') + title = ' '.join([os.path.basename(args[0])] + args[1:]) return self.get_response("""%s
 %s
 
@@ -62,4 +64,4 @@ def error(self): """deal with non-supported methods""" return exc.HTTPMethodNotAllowed("Only %r operations are allowed" % self.response_functions.keys()) - + diff -r 2f45e6ae75fc -r 79a43cbdf584 setup.py --- a/setup.py Fri Feb 26 13:23:52 2010 -0500 +++ b/setup.py Tue Dec 20 11:34:10 2011 -0800 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import sys, os -version = "0.1" +version = "0.1.1" setup(name='clwapp', version=version,