<!--
 * @Author: your name
 * @Date: 2021-07-15 09:33:39
 * @LastEditTime: 2021-07-19 17:04:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \evm-store\tools\README.md
-->
# 代码生成工具

使用Python Jinja2模板引擎，自动生成代码。

# 参考资料链接

- https://flask.palletsprojects.com/en/1.1.x/api/
- https://flask-sqlalchemy.palletsprojects.com/en/2.x/
- http://www.pythondoc.com/flask-sqlalchemy/index.html
- https://jinja.palletsprojects.com/en/2.11.x/templates/
- marshmallow: https://www.cnblogs.com/dowi/p/11850558.html
- https://flask-marshmallow.readthedocs.io/en/latest/
- https://docs.pyfilesystem.org/en/latest/index.html
- https://jinja.palletsprojects.com/en/3.0.x/
- https://www.jb51.net/article/205786.htm
- https://blog.csdn.net/weixin_39352048/article/details/80363326

# 问题

## ModuleNotFoundError: No module named 'flask._compat'

解决方法：
```
On this specific error: from flask._compat import text_type
ModuleNotFoundError: No module named 'flask._compat' -

It happened because the python searched on Flask._compat directory and It isn't there, so I changed like on below : (on flask_script/__init__.py)

Where:

`from ._compat import text_type` on original flask-script file

to :

`from flask_script._compat import text_type`

Then It works !!
```

## ModuleNotFoundError: No module named 'fcntl'

解决方法：

输入以下代码并保存至Python安装目录的Lib目录下

```
LOCK_UN=8
LOCK_EX=2
F_GETFD=1
FD_CLOEXEC=1
F_SETFD=2

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

```