Skip to content

Commit

Permalink
use setuptools entrypoints
Browse files Browse the repository at this point in the history
Signed-off-by: Chris “Kwpolska” Warrick <[email protected]>
  • Loading branch information
Kwpolska committed May 21, 2014
1 parent c306b85 commit 2ad4dae
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 34 deletions.
16 changes: 0 additions & 16 deletions bin/pb

This file was deleted.

15 changes: 0 additions & 15 deletions bin/pkgbuilder

This file was deleted.

29 changes: 29 additions & 0 deletions pkgbuilder/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""Run PKGBUILDer or PBWrapper."""
import sys
if sys.version_info[0] < 3:
print('ERROR: RUNNING PY2K INSTEAD OF PY3K.')
print('If you replaced /usr/bin/python with python2, you are an idiot.')
print('Please revert that change.')
exit(1)

import pkgbuilder
import pkgbuilder.main
import pkgbuilder.wrapper

def pkgbuildermain():
try:
pkgbuilder.main.main()
except KeyboardInterrupt:
pkgbuilder.DS.fancy_error(pkgbuilder.DS.inttext)
exit(0)

def pbwrappermain():
try:
pkgbuilder.wrapper.wrapper()
except KeyboardInterrupt:
print(pkgbuilder.DS.wrapperinttext + '\n') # for safety.
exit(0)

if __name__ == '__main__':
pkgbuildermain()
2 changes: 1 addition & 1 deletion pkgbuilder/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import os

__all__ = ['wrapper']
__wrapperversion__ = '0.2.2'
__wrapperversion__ = '0.2.3'


def wrapper(source='AUTO'):
Expand Down
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@
'Topic :: Utilities'],
packages=['pkgbuilder'],
requires=['pyalpm', 'requests'],
scripts=['bin/pkgbuilder', 'bin/pb'],
data_files=[('share/man/man8', ['docs/pkgbuilder.8.gz']),
('share/man/man8', ['docs/pb.8.gz']),
('share/locale/pl/LC_MESSAGES', ['locale/pl/LC_MESSAGES/'
'pkgbuilder.mo']),
('share/locale/ja/LC_MESSAGES', ['locale/ja/LC_MESSAGES/'
'pkgbuilder.mo'])])
'pkgbuilder.mo'])],
entry_points = {
'console_scripts': [
'pkgbuilder = pkgbuilder.__main__:pkgbuildermain',
'pb = pkgbuilder.__main__:pbwrappermain'
]
},
)

0 comments on commit 2ad4dae

Please sign in to comment.