Skip to content

Commit 1bb3bb0

Browse files
committed
Switched to using entry_points
1 parent 06ba16f commit 1bb3bb0

File tree

5 files changed

+21
-83
lines changed

5 files changed

+21
-83
lines changed

bashplotlib/histogram.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
2+
23
import math
34
import optparse
45
import sys
@@ -171,7 +172,7 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="whi
171172
print summary
172173

173174

174-
if __name__=="__main__":
175+
def main():
175176

176177
parser = optparse.OptionParser(usage=hist['usage'])
177178

@@ -208,3 +209,6 @@ def plot_hist(f, height=20.0, bincount=None, binwidth=None, pch="o", colour="whi
208209
else:
209210
print "nothing to plot!"
210211

212+
213+
if __name__=="__main__":
214+
main()

bashplotlib/scatterplot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
2+
23
import csv
34
import optparse
45
import sys
@@ -71,7 +72,7 @@ def plot_scatter(f, xs, ys, size, pch, colour, title):
7172
print "-"*(2*len(get_scale(xs, False, size))+2)
7273

7374

74-
if __name__=="__main__":
75+
def main():
7576

7677
parser = optparse.OptionParser(usage=scatter['usage'])
7778
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):
99100
else:
100101
print "nothing to plot!"
101102

103+
104+
if __name__=="__main__":
105+
main()

bin/hist

Lines changed: 0 additions & 39 deletions
This file was deleted.

bin/scatter

Lines changed: 0 additions & 37 deletions
This file was deleted.

setup.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
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
34

45
setup(
56
name="bashplotlib",
@@ -11,6 +12,11 @@
1112
packages=find_packages(),
1213
description="plotting in the terminal",
1314
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+
}
1521
)
1622

0 commit comments

Comments
 (0)