comfortable-swipe/comfortable_swipe/__main__.py
Rico Tiongson 19734c8a2e
Use Travis CI (#59)
* Package comfortable-swipe with Python (#58)

* Add initial python setup script

* Add working initial python porting definition for comfortable-swipe

* Add python extensions to cpp libraries

* Remove boost and prefer vanilla Python.h implementation

* Add main driver function for comfortable_swipe

* Fix compilation for Python 3

* Remove depcreacted cpp scripts in root

* Move script to entrypoint

* Increment version to beta

* Update variable formatting

* Remove deprecated install script

* Move install to post-install command

* Create install script hooks

* Fix bdist_wheel class errors

* Use absolute path for c++ sources

* Unignore index files

* Move autostart to python

* Allow comfortable swipe autostart for possible virtualenv

* Completely port autostart to python

* Move status to python

* Optimize swipe function

* Remove iostream optimization from buffer

* Register pre-install and post-install in a stack

* Remove underscores from value-defined macros

* Compress default config

* Change cpp to __init__.py

* Error message

* Bugfix for python2

* Use a requirements.txt

* Add initial travis configuration

* Attempt fix travis configuration

* Attempt fix g++ error

* Bugfix missing path dir on autostart

* Add classifiers

* Attempt install build-essential instead of g++

* Add missing psutil from requirements

* Modify README

* Attempt fix build errors in travis

* Update README

* Add simple build badges
2019-03-08 19:53:27 +08:00

29 lines
718 B
Python

from __future__ import print_function
import sys
from comfortable_swipe.autostart import toggle_status
from comfortable_swipe.constants import CONFIG
from comfortable_swipe.status import print_status
from comfortable_swipe.cpp import service as cpp_service
def main():
if len(sys.argv) <= 1:
cpp_service.help()
else:
dict(
start=cpp_service.start,
stop=cpp_service.stop,
restart=cpp_service.restart,
buffer=cpp_service.buffer,
help=cpp_service.help,
debug=cpp_service.debug,
status=print_status,
autostart=lambda: print('Autostart switched', toggle_status()),
config=lambda: print(CONFIG),
)[sys.argv[1]]()
if __name__ == '__main__':
main()