GeezerVison is showing github.com — Switched to using entry_points · NeelShah18/bashplotlib@1bb3bb0
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: bashplotlib/histogram.py +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#!/usr/bin/python | | 1 | +#!/usr/bin/env python | | 2 | + | 2 | 3 | import math | 3 | 4 | import optparse | 4 | 5 | import sys | @@ -171,7 +172,7 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="whi | 171 | 172 | print summary | 172 | 173 |
| 173 | 174 |
| 174 | | -if __name__=="__main__": | | 175 | +def main(): | 175 | 176 |
| 176 | 177 | parser = optparse.OptionParser(usage=hist['usage']) | 177 | 178 |
| @@ -208,3 +209,6 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="whi | 208 | 209 | else: | 209 | 210 | print "nothing to plot!" | 210 | 211 |
| | 212 | + | | 213 | +if __name__=="__main__": | | 214 | + main() |
Collapse file Copy file name to clipboardExpand all lines: bashplotlib/scatterplot.py +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -#!/usr/bin/python | | 1 | +#!/usr/bin/env python | | 2 | + | 2 | 3 | import csv | 3 | 4 | import optparse | 4 | 5 | import sys | @@ -71,7 +72,7 @@ def plot_scatter(f, xs, ys, size, pch, colour, title): | 71 | 72 | print "-"*(2*len(get_scale(xs, False, size))+2) | 72 | 73 |
| 73 | 74 |
| 74 | | -if __name__=="__main__": | | 75 | +def main(): | 75 | 76 |
| 76 | 77 | parser = optparse.OptionParser(usage=scatter['usage']) | 77 | 78 | parser.add_option('-f', '--file', help='a csv w/ x and y coordinates', | @@ -99,3 +100,6 @@ def plot_scatter(f, xs, ys, size, pch, colour, title): | 99 | 100 | else: | 100 | 101 | print "nothing to plot!" | 101 | 102 |
| | 103 | + | | 104 | +if __name__=="__main__": | | 105 | + main() |
Collapse file Copy file name to clipboardExpand all lines: bin/hist -39Lines changed: 0 additions & 39 deletions Collapse file Copy file name to clipboardExpand all lines: bin/scatter -37Lines changed: 0 additions & 37 deletions Collapse file Copy file name to clipboardExpand all lines: setup.py +9-3Lines changed: 9 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -from distutils.core import setup | 2 | | -from setuptools import find_packages | | 1 | +#!/usr/bin/env python | | 2 | + | | 3 | +from setuptools import find_packages, setup | 3 | 4 |
| 4 | 5 | setup( | 5 | 6 | name="bashplotlib", | | 11 | 12 | packages=find_packages(), | 12 | 13 | description="plotting in the terminal", | 13 | 14 | long_description=open("README.md").read(), | 14 | | - scripts=['bin/hist', 'bin/scatter'], | | 15 | + entry_points = { | | 16 | + 'console_scripts': [ | | 17 | + 'hist=bashplotlib.histogram:main', | | 18 | + 'scatter=bashplotlib.scatterplot:main', | | 19 | + ] | | 20 | + } | 15 | 21 | ) | 16 | 22 |
|
|