Commit e84a2116 authored by Hugo Hörnquist's avatar Hugo Hörnquist

Add setup.py. Move machine.py into library.

Moved machine.py into a library, and made main a procedure. setup.py
installs it both as a library, and as a binary. The binary is called
time-machine and is usually placed in /usr/bin/.
parent 8fe5e4a3
#!/usr/bin/env python2
from setuptools import setup
setup(name = "time_machine",
version = "0.1",
author = "Hugo Hornquist",
author_email = "hugo@lysator.liu.se",
description = "A program for measuring times.",
license = "MIT",
url = "https://git.lysator.liu.se/hugo/time-machine",
packages = ["time_machine"],
entry_points = {
"console_scripts": [
"time-machine = time_machine.machine:main"
]
}
)
name = "time_machine"
......@@ -109,7 +109,7 @@ def wait_btn():
return g.wait_for_edge(btn_pin, g.RISING, bouncetime=500)
#g.wait_for_edge(btn_pin, g.RISING)
if __name__ == "__main__":
def main():
while True:
if state == States.no_hafv:
print
......@@ -149,3 +149,6 @@ if __name__ == "__main__":
lcd_info("Avvakta")
state = States.no_hafv
time.sleep(1)
if __name__ == "__main__":
main()
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