X Tutup
Skip to content

Commit 645e978

Browse files
committed
Fix reading of logo.
Add logo to package data. Create entry point for bpython-gtk --HG-- branch : GTK-prettify rename : data/logo.png => bpython/logo.png
1 parent 1ea4ffe commit 645e978

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

bpython/gtk_.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from __future__ import with_statement
3131
import inspect
3232
import sys
33+
import os
3334
from locale import LC_ALL, getpreferredencoding, setlocale
3435

3536
import gobject
@@ -639,7 +640,8 @@ def main(args=None):
639640
# branding
640641

641642
# fix icon to be distributed and loaded from the correct path
642-
icon = gtk.gdk.pixbuf_new_from_file('/home/simon/src/bpython/data/logo.png')
643+
icon = gtk.gdk.pixbuf_new_from_file(os.path.join(os.path.dirname(__file__),
644+
'logo.png'))
643645

644646
window.set_title('bpython')
645647
window.set_icon(icon)
File renamed without changes.

data/bpython-gtk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env python
2+
3+
import sys
4+
from bpython.gtk_ import main
5+
6+
sys.exit(main())

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@
4646
(os.path.join(man_dir, 'man5'), ['doc/bpython-config.5']),
4747
('share/applications', ['data/bpython.desktop'])
4848
],
49+
package_data = {'bpython': ['logo.png']},
4950
entry_points = {
5051
'console_scripts': [
5152
'bpython = bpython.cli:main',
53+
'bpython-gtk = bpython.gtk_:main',
5254
],
5355
},
54-
scripts = ([] if using_setuptools else ['data/bpython']),
56+
scripts = ([] if using_setuptools else ['data/bpython',
57+
'data/bpython-gtk']),
5558
cmdclass=dict(build_py=build_py)
5659
)
5760

0 commit comments

Comments
 (0)
X Tutup