OnionIoT / tau-lidar-server

Python package for Tau Lidar Camera application
MIT License
27 stars 7 forks source link

Developer can launch the server by installing the python package and running a single command #1

Closed greenbreakfast closed 3 years ago

greenbreakfast commented 3 years ago

User Story

  1. Developer performs local installation of package through pip
  2. Developer runs command python -m TauLidarServer
  3. Observe messages reporting camera is connected
  4. Observe messages reporting web server has started

Context

To be able to package this module, we first need to wrap the existing contents of server.py into a function.

References

greenbreakfast commented 3 years ago

@vsemi need your help to wrap the existing contents of server.py into a function

vsemi commented 3 years ago

Moved everything into main function.

vsemi commented 3 years ago

@greenbreakfast content of server.py wrapped into main function, will you try build and upload if it works?

greenbreakfast commented 3 years ago

@vsemi thanks! I followed the python packaging guide linked above and now we can start the server by running python -m TauLidarServer (as long as the package is installed).

See the updated development guide for instructions on how to install locally and run it.

The only problem is the web-server hosts the directory where the python -m TauLidarServer command is run, and not the directory with our index.html I'll look into fixing that. EDIT: commit c57e6d7 fixes the issue. Runs as expected now!