Skip to content

Commit 1ed7d19

Browse files
author
Bob Farrell
committed
Merge commit 'd1024000b6d18ab3a835b8da41eed8cf058536ad'
committer: Bob Farrell <bob@keys.(none)>
2 parents 65e7a0e + 38318cd commit 1ed7d19

3 files changed

Lines changed: 39 additions & 49 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
*.pyc
2+
*.egg-info
3+
build
4+
dist

bpython.py renamed to bpython/cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ def loadrc():
15381538

15391539
stdscr = None
15401540

1541-
def main( scr ):
1541+
def main_curses( scr ):
15421542
"""main function for the curses convenience wrapper
15431543
15441544
Initialise the two main objects: the interpreter
@@ -1580,10 +1580,10 @@ def main( scr ):
15801580

15811581
return repl.getstdout()
15821582

1583-
if __name__ == '__main__':
1583+
def main():
15841584
tb = None
15851585
try:
1586-
o = curses.wrapper( main )
1586+
o = curses.wrapper( main_curses )
15871587
except:
15881588
tb = traceback.format_exc()
15891589
# I don't know why this is necessary; without it the wrapper doesn't always
@@ -1601,3 +1601,6 @@ def main( scr ):
16011601

16021602
sys.stdout.write( o ) # Fake stdout data so everything's still visible after exiting
16031603
sys.stdout.flush()
1604+
1605+
if __name__ == '__main__':
1606+
main()

‎setup.py‎

Lines changed: 30 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,41 @@
11
#!/usr/bin/env python
2-
from distutils.command.install_data import install_data
3-
from distutils.sysconfig import get_python_lib
4-
from distutils.core import setup, Extension
5-
from distutils.dep_util import newer
6-
from distutils.log import info
7-
from distutils import sysconfig
8-
import distutils.file_util
9-
import distutils.dir_util
2+
# -*- coding: utf-8 -*-
3+
4+
from setuptools import setup
105
import sys, os
116
import glob
127
import platform
138
import re
149

15-
# Make distutils copy bpython.py to bpython
16-
copy_file_orig = distutils.file_util.copy_file
17-
copy_tree_orig = distutils.dir_util.copy_tree
18-
def copy_file(src, dst, *args, **kwargs):
19-
if dst.endswith("bin/bpython.py"):
20-
dst = dst[:-3]
21-
return copy_file_orig(src, dst, *args, **kwargs)
22-
def copy_tree(*args, **kwargs):
23-
outputs = copy_tree_orig(*args, **kwargs)
24-
for i in range(len(outputs)):
25-
if outputs[i].endswith("bin/bpython.py"):
26-
outputs[i] = outputs[i][:-3]
27-
return outputs
28-
distutils.file_util.copy_file = copy_file
29-
distutils.dir_util.copy_tree = copy_tree
30-
31-
PYTHONLIB = os.path.join(get_python_lib(standard_lib=1, prefix=""),
32-
"site-packages")
33-
3410
if platform.system() == 'FreeBSD':
3511
man_dir = 'man'
3612
else:
3713
man_dir = 'share/man'
3814

39-
setup(name="bpython",
40-
version = "0.6.4",
41-
description = "Fancy Interface to the Python Interpreter",
42-
author = "Robert Anthony Farrell",
43-
author_email = "robertanthonyfarrell@gmail.com",
44-
license = "MIT/X",
45-
url = "http://www.noiseforfree.com/bpython/",
46-
long_description =
47-
"""\
48-
bpython is a fancy interface to the Python interpreter for Unix-like operating systems.
49-
""",
50-
packages = ["bpython"],
51-
scripts = ["bpython.py"],
52-
data_files = [
53-
(os.path.join(man_dir, 'man1'), ['doc/bpython.1']),
54-
(os.path.join(man_dir, 'man5'), ['doc/bpythonrc.5']),
55-
('share/applications', ['data/bpython.desktop'])
56-
]
57-
)
15+
setup(
16+
name="bpython",
17+
version = "0.6.4",
18+
author = "Robert Anthony Farrell",
19+
author_email = "robertanthonyfarrell@gmail.com",
20+
description = "Fancy Interface to the Python Interpreter",
21+
license = "MIT/X",
22+
url = "http://www.noiseforfree.com/bpython/",
23+
long_description = """bpython is a fancy interface to the Python interpreter for Unix-like operating systems.""",
24+
install_requires = [
25+
'pygments',
26+
'pyparsing',
27+
],
28+
packages = ["bpython"],
29+
data_files = [
30+
(os.path.join(man_dir, 'man1'), ['doc/bpython.1']),
31+
(os.path.join(man_dir, 'man5'), ['doc/bpythonrc.5']),
32+
('share/applications', ['data/bpython.desktop'])
33+
],
34+
entry_points = {
35+
'console_scripts': [
36+
'bpython = bpython.cli:main'
37+
],
38+
}
39+
)
40+
41+
# vim: encoding=utf-8 sw=4 ts=4 sts=4 ai et sta

0 commit comments

Comments
 (0)