|
14 | 14 | from lib.core.common import setPaths |
15 | 15 | from lib.core.data import paths |
16 | 16 | from lib.core.data import logger |
| 17 | +from lib.core.settings import RESTAPI_DEFAULT_ADDRESS |
| 18 | +from lib.core.settings import RESTAPI_DEFAULT_PORT |
17 | 19 | from lib.utils.api import client |
18 | 20 | from lib.utils.api import server |
19 | 21 |
|
20 | | -RESTAPI_SERVER_HOST = "127.0.0.1" |
21 | | -RESTAPI_SERVER_PORT = 8775 |
22 | | - |
23 | 22 | if __name__ == "__main__": |
24 | 23 | """ |
25 | 24 | REST-JSON API main function |
|
33 | 32 |
|
34 | 33 | # Parse command line options |
35 | 34 | apiparser = optparse.OptionParser() |
36 | | - apiparser.add_option("-s", "--server", help="Act as a REST-JSON API server", default=RESTAPI_SERVER_PORT, action="store_true") |
37 | | - apiparser.add_option("-c", "--client", help="Act as a REST-JSON API client", default=RESTAPI_SERVER_PORT, action="store_true") |
38 | | - apiparser.add_option("-H", "--host", help="Host of the REST-JSON API server", default=RESTAPI_SERVER_HOST, action="store") |
39 | | - apiparser.add_option("-p", "--port", help="Port of the the REST-JSON API server", default=RESTAPI_SERVER_PORT, type="int", action="store") |
| 35 | + apiparser.add_option("-s", "--server", help="Act as a REST-JSON API server", default=RESTAPI_DEFAULT_PORT, action="store_true") |
| 36 | + apiparser.add_option("-c", "--client", help="Act as a REST-JSON API client", default=RESTAPI_DEFAULT_PORT, action="store_true") |
| 37 | + apiparser.add_option("-H", "--host", help="Host of the REST-JSON API server", default=RESTAPI_DEFAULT_ADDRESS, action="store") |
| 38 | + apiparser.add_option("-p", "--port", help="Port of the the REST-JSON API server", default=RESTAPI_DEFAULT_PORT, type="int", action="store") |
40 | 39 | (args, _) = apiparser.parse_args() |
41 | 40 |
|
42 | 41 | # Start the client or the server |
|
0 commit comments