# HG changeset patch # User Jeff Hammel # Date 1409795243 25200 # Node ID 690778ffd3029736e6d88f0046baf4da5d92a0b9 # Parent 2d7d3034db1871ff94ab19d3cbc855270c624c6a rename diff -r 2d7d3034db18 -r 690778ffd302 kplot/__init__.py --- a/kplot/__init__.py Thu Aug 14 16:34:04 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -# -from main import * - diff -r 2d7d3034db18 -r 690778ffd302 kplot/main.py --- a/kplot/main.py Thu Aug 14 16:34:04 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -personal experiments in plotting -""" - -# imports -import argparse -import os -import subprocess -import sys - -# module globals -__all__ = ['main', 'Parser'] -here = os.path.dirname(os.path.realpath(__file__)) -string = (str, unicode) - -def ensure_dir(directory): - """ensure a directory exists""" - if os.path.exists(directory): - assert os.path.isdir(directory) - return directory - os.makedirs(directory) - return directory - - -class Parser(argparse.ArgumentParser): - """CLI option parser""" - def __init__(self, **kwargs): - kwargs.setdefault('description', __doc__) - argparse.ArgumentParser.__init__(self, **kwargs) - self.options = None - - def parse_args(self, *args, **kw): - options = argparse.ArgumentParser.parse_args(self, *args, **kw) - self.validate(options) - self.options = options - return options - - def validate(self, options): - """validate options""" - -def main(args=sys.argv[1:]): - """CLI""" - - # parse command line options - parser = Parser() - options = parser.parse_args(args) - -if __name__ == '__main__': - main() - diff -r 2d7d3034db18 -r 690778ffd302 kplot/template.py --- a/kplot/template.py Thu Aug 14 16:34:04 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -#!/usr/bin/env python - -""" -kplot template for makeitso -""" - -import sys -from cli import MakeItSoCLI -from optparse import OptionParser -from template import MakeItSoTemplate - -class kplotTemplate(MakeItSoTemplate): - """ - kplot template - """ - name = 'kplot' - templates = ['template'] - look = True - -class TemplateCLI(MakeItSoCLI): - """ - CLI driver for the kplot template - """ - -def main(args=sys.argv[:]): - cli = TemplateCLI() - cli(*args) - -if __name__ == '__main__': - main() - - diff -r 2d7d3034db18 -r 690778ffd302 kplot/web.py --- a/kplot/web.py Thu Aug 14 16:34:04 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -#!/usr/bin/env python - -""" -web handler for kplot -""" - -from webob import Request, Response, exc - -class Handler(object): - - def __init__(self, **kw): - pass - - def __call__(self, environ, start_response): - request = Request(environ) - response = Response(content_type='text/plain', - body="kplot") - return response(environ, start_response) - -if __name__ == '__main__': - from wsgiref import simple_server - app = Handler() - server = simple_server.make_server(host='0.0.0.0', port=8080, app=app) - server.serve_forever() - - diff -r 2d7d3034db18 -r 690778ffd302 numerics/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/numerics/__init__.py Wed Sep 03 18:47:23 2014 -0700 @@ -0,0 +1,3 @@ +# +from main import * + diff -r 2d7d3034db18 -r 690778ffd302 numerics/main.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/numerics/main.py Wed Sep 03 18:47:23 2014 -0700 @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +personal experiments in plotting +""" + +# imports +import argparse +import os +import subprocess +import sys + +# module globals +__all__ = ['main', 'Parser'] +here = os.path.dirname(os.path.realpath(__file__)) +string = (str, unicode) + +def ensure_dir(directory): + """ensure a directory exists""" + if os.path.exists(directory): + assert os.path.isdir(directory) + return directory + os.makedirs(directory) + return directory + + +class Parser(argparse.ArgumentParser): + """CLI option parser""" + def __init__(self, **kwargs): + kwargs.setdefault('description', __doc__) + argparse.ArgumentParser.__init__(self, **kwargs) + self.options = None + + def parse_args(self, *args, **kw): + options = argparse.ArgumentParser.parse_args(self, *args, **kw) + self.validate(options) + self.options = options + return options + + def validate(self, options): + """validate options""" + +def main(args=sys.argv[1:]): + """CLI""" + + # parse command line options + parser = Parser() + options = parser.parse_args(args) + +if __name__ == '__main__': + main() + diff -r 2d7d3034db18 -r 690778ffd302 numerics/template.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/numerics/template.py Wed Sep 03 18:47:23 2014 -0700 @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +""" +kplot template for makeitso +""" + +import sys +from cli import MakeItSoCLI +from optparse import OptionParser +from template import MakeItSoTemplate + +class kplotTemplate(MakeItSoTemplate): + """ + kplot template + """ + name = 'kplot' + templates = ['template'] + look = True + +class TemplateCLI(MakeItSoCLI): + """ + CLI driver for the kplot template + """ + +def main(args=sys.argv[:]): + cli = TemplateCLI() + cli(*args) + +if __name__ == '__main__': + main() + + diff -r 2d7d3034db18 -r 690778ffd302 numerics/web.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/numerics/web.py Wed Sep 03 18:47:23 2014 -0700 @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +""" +web handler for kplot +""" + +from webob import Request, Response, exc + +class Handler(object): + + def __init__(self, **kw): + pass + + def __call__(self, environ, start_response): + request = Request(environ) + response = Response(content_type='text/plain', + body="kplot") + return response(environ, start_response) + +if __name__ == '__main__': + from wsgiref import simple_server + app = Handler() + server = simple_server.make_server(host='0.0.0.0', port=8080, app=app) + server.serve_forever() + + diff -r 2d7d3034db18 -r 690778ffd302 setup.py --- a/setup.py Thu Aug 14 16:34:04 2014 -0700 +++ b/setup.py Wed Sep 03 18:47:23 2014 -0700 @@ -1,5 +1,5 @@ """ -setup packaging script for kplot +setup packaging script for numerics """ import os @@ -16,7 +16,6 @@ from setuptools import setup kw['entry_points'] = """ [console_scripts] - kplot = kplot.main:main """ kw['install_requires'] = dependencies except ImportError: @@ -30,18 +29,17 @@ description = '' -setup(name='kplot', +setup(name='numerics', version=version, - description="personal experiments in plotting", + description="personal experiments in numerics + plotting", long_description=description, classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers author='Jeff Hammel', author_email='k0scist@gmail.com', - url='http://k0s.org/hg/kplot', + url='http://k0s.org/hg/numerics', license='', - packages=['kplot'], + packages=['numerics'], include_package_data=True, zip_safe=False, **kw ) -