# HG changeset patch # User Jeff Hammel # Date 1268261291 18000 # Node ID 12ac99c240ca306f4b669c35d7e1e3d4c61cdc0f # Parent 1eea6356d2e53f6895e35985fddc80d73d5df425 * add documentation * add 1..10 autostep feature * bump version diff -r 1eea6356d2e5 -r 12ac99c240ca README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.txt Wed Mar 10 17:48:11 2010 -0500 @@ -0,0 +1,26 @@ +webcalc +======= + +*through the web calculator* + +Usage +----- + +webcalc uses the full path of the URL as a calculator: + + ``http://127.0.0.1:5151/(5+3)/2`` + +Should yield a ``text/plain`` document with contents ``4.0``. + +Query string arguments may be used to iterate over arguments: + + ``http://127.0.0.1:5151/(5+a)/2?a=1..10`` + +Values and ranges may be comma separated (e.g. ``a=1,3,5..10``). +Ranges may be specified as *start, step, end*. If *step* is omitted, +it is taken to be 1.0. + +TODO +---- + + * add multiple front ends, including a graphing calculator diff -r 1eea6356d2e5 -r 12ac99c240ca setup.py --- a/setup.py Mon Sep 07 15:09:03 2009 -0400 +++ b/setup.py Wed Mar 10 17:48:11 2010 -0500 @@ -1,12 +1,19 @@ from setuptools import setup, find_packages +import os -version = "0.1" +# get the description from the README +try: + filename = os.path.join(os.path.dirname(__file__), 'README.txt') + description = file(filename).read() +except: + description = '' + +version = "0.1.1" setup(name='webcalc', version=version, description="web-based calculator", - long_description=""" -""", + long_description=description, classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers author='Jeff Hammel', author_email='k0scist@gmail.com', diff -r 1eea6356d2e5 -r 12ac99c240ca webcalc/webcalc.py --- a/webcalc/webcalc.py Mon Sep 07 15:09:03 2009 -0400 +++ b/webcalc/webcalc.py Wed Mar 10 17:48:11 2010 -0500 @@ -129,7 +129,13 @@ continue except ValueError: pass - start, step, end = token.split('..') + count = token.count('..') + assert count in set([1,2]) + if count == 1: + start, end = token.split('..') + step = 1.0 + else: # count == 2 + start, step, end = token.split('..') start = float(start) step = float(step) end = float(end)