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(
packages=find_packages(),
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):
sys.stdout.flush()
def main(argv, Controler=None):
def runner(argv, Controler=None):
flushprint("start")
try:
options, argv = getopt.getopt(
......@@ -90,5 +90,5 @@ def main(argv, Controler=None):
sys.exit(-1)
if __name__ == "__main__":
sys.exit(main(sys.argv))
def main() :
runner(sys.argv)
......@@ -10,7 +10,8 @@ import struct
import sys
import socket
import select
from . import consts
import yggdrasil
from yggdrasil.isengard import consts
from threading import Thread
from threading import Timer
from threading import Lock
......@@ -860,7 +861,8 @@ class Bridge(Thread):
# 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
# given on parameters
def main(argv):
def main():
argv = sys.argv
sys.stderr = sys.stdout
try:
options, argv = getopt.getopt(
......@@ -892,6 +894,3 @@ def main(argv):
bridge.start()
bridge.log_to_father("control -> {}".format(control_adress))
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