GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Switched to using entry_points · NeelShah18/bashplotlib@1bb3bb0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • bashplotlib
    • histogram.py
    • scatterplot.py
  • bin
    • hist
    • scatter
  • setup.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bashplotlib/histogram.py‎

Copy file name to clipboardExpand all lines: bashplotlib/histogram.py
+6-2Lines 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()
Collapse file

‎bashplotlib/scatterplot.py‎

Copy file name to clipboardExpand all lines: bashplotlib/scatterplot.py
+6-2Lines 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()
Collapse file

‎bin/hist‎

Copy file name to clipboardExpand all lines: bin/hist
-39Lines changed: 0 additions & 39 deletions
This file was deleted.
Collapse file

‎bin/scatter‎

Copy file name to clipboardExpand all lines: bin/scatter
-37Lines changed: 0 additions & 37 deletions
This file was deleted.
Collapse file

‎setup.py‎

Copy file name to clipboardExpand all lines: setup.py
+9-3Lines 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 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.