Commit f09ef1f2 authored by lavocat's avatar lavocat
Browse files

Create entry-points on binaries

parent 92426c09
This diff is collapsed.
...@@ -21,5 +21,11 @@ setup( ...@@ -21,5 +21,11 @@ setup(
packages=find_packages(), packages=find_packages(),
install_requires=['pyzmq', 'pexpect'], install_requires=['pyzmq', 'pexpect'],
scripts=['bin/erebor', 'bin/socket-bridge']
) entry_points={
'console_scripts': [
'erebor=yggdrasil.erebor.main:main',
'socket-bridge=yggdrasil.isengard.socket_bridge:main',
],
}
)
...@@ -11,7 +11,7 @@ def flushprint(*args, **kwargs): ...@@ -11,7 +11,7 @@ def flushprint(*args, **kwargs):
sys.stdout.flush() sys.stdout.flush()
def main(argv, Controler=None): def runner(argv, Controler=None):
flushprint("start") flushprint("start")
try: try:
options, argv = getopt.getopt( options, argv = getopt.getopt(
...@@ -90,5 +90,5 @@ def main(argv, Controler=None): ...@@ -90,5 +90,5 @@ def main(argv, Controler=None):
sys.exit(-1) sys.exit(-1)
if __name__ == "__main__": def main() :
sys.exit(main(sys.argv)) runner(sys.argv)
...@@ -10,7 +10,8 @@ import struct ...@@ -10,7 +10,8 @@ import struct
import sys import sys
import socket import socket
import select import select
from . import consts import yggdrasil
from yggdrasil.isengard import consts
from threading import Thread from threading import Thread
from threading import Timer from threading import Timer
from threading import Lock from threading import Lock
...@@ -860,7 +861,8 @@ class Bridge(Thread): ...@@ -860,7 +861,8 @@ class Bridge(Thread):
# This one will be asked to be launched by the main one on taktuk. # This one will be asked to be launched by the main one on taktuk.
# The main one will access to the bridge through another unix socket, on the file # The main one will access to the bridge through another unix socket, on the file
# given on parameters # given on parameters
def main(argv): def main():
argv = sys.argv
sys.stderr = sys.stdout sys.stderr = sys.stdout
try: try:
options, argv = getopt.getopt( options, argv = getopt.getopt(
...@@ -892,6 +894,3 @@ def main(argv): ...@@ -892,6 +894,3 @@ def main(argv):
bridge.start() bridge.start()
bridge.log_to_father("control -> {}".format(control_adress)) bridge.log_to_father("control -> {}".format(control_adress))
bridge.join() bridge.join()
if __name__ == "__main__":
sys.exit(main(sys.argv))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment