diff --git a/myems-api/README.md b/myems-api/README.md index 3143cb0a..0c5caca2 100644 --- a/myems-api/README.md +++ b/myems-api/README.md @@ -32,6 +32,7 @@ python-decouple ## Quick Run for Development +Quick run on Linux (NOT for production use): ```bash cd myems/myems-api sudo pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com @@ -40,6 +41,26 @@ sudo chmod +x run.sh ./run.sh ``` +Quick run on Windows (NOT for production use): +Find python path in Command Prompt: +```bash +where python +``` +Assume the result is 'C:\Users\johnson\AppData\Local\Programs\Python\Python310\python.exe' +Copy fcntl.py and pwd.py to lib folder: +```bash +cp myems\myems-api\fcntl.py C:\Users\johnson\AppData\Local\Programs\Python\Python310\Lib +cp myems\myems-api\pwd.py C:\Users\johnson\AppData\Local\Programs\Python\Python310\Lib +``` + +Install and run with waitress: +```bash +pip install waitress +cd myems\myems-api +waitress-serve --listen=127.0.0.1:8000 app:api +``` + + ## Installation ### Installation Option 1: Install myems-api on Docker @@ -2672,6 +2693,8 @@ curl -i -X GET {{base_url}}/reports/virtualmetercost?virtualmeterid=1&periodtype [8]. https://foss.heptapod.net/openpyxl/et_xmlfile/ +[9]. https://docs.pylonsproject.org/projects/waitress/en/latest/ + diff --git a/myems-api/fcntl.py b/myems-api/fcntl.py new file mode 100644 index 00000000..3791fbf6 --- /dev/null +++ b/myems-api/fcntl.py @@ -0,0 +1,17 @@ +def fcntl(fd, op, arg=0): + return 0 + + +def ioctl(fd, op, arg=0, mutable_flag=True): + if mutable_flag: + return 0 + else: + return "" + + +def flock(fd, op): + return + + +def lockf(fd, operation, length=0, start=0, whence=0): + return diff --git a/myems-api/pwd.py b/myems-api/pwd.py new file mode 100644 index 00000000..5566e132 --- /dev/null +++ b/myems-api/pwd.py @@ -0,0 +1 @@ +# left blank intentionally