Skip to content

Commit 441dcb8

Browse files
committed
[flask_func_struct] refactor done, updated github workflow actions, docs
1 parent 9163f79 commit 441dcb8

File tree

136 files changed

+14505
-17096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+14505
-17096
lines changed

.gitconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git config -f .gitconfig core.hooksPath .githooks

.githooks/commit-msg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
#
3+
# @brief Add project name
4+
# @version ver.1.0.0
5+
# @date Thu Apr 08 03:47:43 AM CET 2021
6+
# @company None, free software to use 2021
7+
# @author Vladimir Roncevic <elektron.ronca@gmail.com>
8+
#
9+
10+
PRO_NAME=$(basename `git rev-parse --show-toplevel`)
11+
echo "[$PRO_NAME] ""$(cat $1)" > "$1"

.githooks/pre-commit

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/sh
2+
#
3+
# @brief Add project name
4+
# @version ver.1.0.0
5+
# @date Thu Apr 08 03:47:43 AM CET 2021
6+
# @company None, free software to use 2021
7+
# @author Vladimir Roncevic <elektron.ronca@gmail.com>
8+
#
9+
10+
if git rev-parse --verify HEAD >/dev/null 2>&1
11+
then
12+
against=HEAD
13+
else
14+
# Initial commit: diff against an empty tree object
15+
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
16+
fi
17+
18+
# If you want to allow non-ASCII filenames set this variable to true.
19+
allownonascii=$(git config --bool hooks.allownonascii)
20+
21+
# Redirect output to stderr.
22+
exec 1>&2
23+
24+
# Cross platform projects tend to avoid non-ASCII filenames; prevent
25+
# them from being added to the repository. We exploit the fact that the
26+
# printable range starts at the space character and ends with tilde.
27+
if [ "$allownonascii" != "true" ] &&
28+
# Note that the use of brackets around a tr range is ok here, (it's
29+
# even required, for portability to Solaris 10's /usr/bin/tr), since
30+
# the square bracket bytes happen to fall in the designated range.
31+
test $(git diff --cached --name-only --diff-filter=A -z $against |
32+
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
33+
then
34+
cat <<\EOF
35+
Error: Attempt to add a non-ASCII file name.
36+
37+
This can cause problems if you want to work with people on other platforms.
38+
39+
To be portable it is advisable to rename the file.
40+
41+
If you know what you are doing you can disable this check using:
42+
43+
git config hooks.allownonascii true
44+
EOF
45+
exit 1
46+
fi
47+
48+
# If there are whitespace errors, print the offending file names and fail.
49+
exec git diff-index --check --cached $against --

.github/workflows/flask_func_struct_docker_checker.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: flask_func_struct docker checker
2-
32
on:
43
push:
54
branches: [ master ]
5+
paths:
6+
- 'Dockerfile'
67
pull_request:
78
branches: [ master ]
8-
9+
paths:
10+
- 'Dockerfile'
911
jobs:
1012
build:
1113
runs-on: ubuntu-latest

.github/workflows/flask_func_struct_package.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
name: Python package flask_func_struct
2-
1+
name: Python package flask_func_structs
32
on:
43
push:
54
branches: [ master ]
5+
paths:
6+
- 'app_server/**'
7+
- 'setup.py'
68
pull_request:
79
branches: [ master ]
8-
10+
paths:
11+
- 'app_server/**'
12+
- 'setup.py'
913
jobs:
1014
build:
11-
1215
runs-on: ubuntu-latest
1316
strategy:
1417
matrix:
1518
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
16-
1719
steps:
1820
- uses: actions/checkout@v2
1921
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/flask_func_struct_py_checker.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: flask_func_struct py checker
22
on:
33
push:
44
branches: [ master ]
5+
paths:
6+
- 'app_server/**'
7+
- 'setup.py'
58
pull_request:
69
branches: [ master ]
10+
paths:
11+
- 'app_server/**'
12+
- 'setup.py'
713
jobs:
814
build:
915
runs-on: ubuntu-latest

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
python:
3-
version: 2.7
3+
version: '3.7'
44
install:
55
- requirements: requirements.txt
66
sphinx:

README.md

Lines changed: 70 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ other information that should be provided before the modules are installed.
2828

2929
Navigate to **[release page](https://github.com/vroncevic/flask_func_struct/releases)** download and extract release archive.
3030

31-
To install modules type the following:
32-
31+
To install modules type the following
3332
```
3433
tar xvzf flask_func_struct-x.y.z.tar.gz
3534
cd flask_func_struct-x.y.z/
@@ -45,8 +44,7 @@ Or You can use docker to create image/container.
4544

4645
### Dependencies
4746

48-
**flask_func_struct** requires other modules and libraries (Python 2.x/3.x):
49-
47+
**flask_func_struct** requires other modules and libraries (Python 2.x/3.x)
5048
```
5149
* Flask
5250
* Flask-Migrate
@@ -64,96 +62,83 @@ Or You can use docker to create image/container.
6462

6563
### Package structure
6664

67-
Expected framework structure:
68-
65+
Expected framework structure
6966
```
70-
.
71-
├── app_server/
72-
│   ├── configuration/
73-
│   │   ├── database/
74-
│   │   │   ├── development_config.py
75-
│   │   │   ├── __init__.py
76-
│   │   │   ├── production_config.py
77-
│   │   │   └── test_config.py
67+
app_server/
68+
├── configuration/
69+
│   ├── database/
7870
│   │   ├── development_config.py
7971
│   │   ├── __init__.py
80-
│   │   ├── mail/
81-
│   │   │   ├── development_config.py
82-
│   │   │   ├── __init__.py
83-
│   │   │   ├── production_config.py
84-
│   │   │   └── test_config.py
8572
│   │   ├── production_config.py
8673
│   │   └── test_config.py
87-
│   ├── forms/
88-
│   │   ├── base/
89-
│   │   │   ├── contact.py
90-
│   │   │   └── __init__.py
91-
│   │   ├── __init__.py
92-
│   │   └── user/
93-
│   │   ├── edit.py
94-
│   │   ├── __init__.py
95-
│   │   ├── login.py
96-
│   │   └── register.py
74+
│   ├── development_config.py
9775
│   ├── __init__.py
98-
│   ├── models/
99-
│   │   ├── __init__.py
100-
│   │   └── model_user.py
101-
│   ├── static/
102-
│   │   ├── base.css
103-
│   │   └── favicon.ico
104-
│   ├── templates/
105-
│   │   ├── base/
106-
│   │   │   ├── about.html
107-
│   │   │   ├── contact.html
108-
│   │   │   └── home.html
109-
│   │   ├── _base.html
110-
│   │   ├── errors/
111-
│   │   │   ├── 401.html
112-
│   │   │   ├── 403.html
113-
│   │   │   ├── 404.html
114-
│   │   │   └── 500.html
115-
│   │   ├── footer.html
116-
│   │   ├── header.html
117-
│   │   └── user/
118-
│   │   ├── administration.html
119-
│   │   ├── edit.html
120-
│   │   ├── login.html
121-
│   │   ├── members.html
122-
│   │   └── register.html
123-
│   ├── tests/
124-
│   │   ├── base_query.py
125-
│   │   ├── helpers.py
76+
│   ├── mail/
77+
│   │   ├── development_config.py
12678
│   │   ├── __init__.py
127-
│   │   ├── sqlalchemy_query.py
128-
│   │   ├── test_config.py
129-
│   │   ├── test_main.py
130-
│   │   └── test_user.py
131-
│   └── views/
132-
│   ├── base/
133-
│   │   ├── about.py
134-
│   │   ├── contact.py
135-
│   │   ├── home.py
136-
│   │   └── __init__.py
79+
│   │   ├── production_config.py
80+
│   │   └── test_config.py
81+
│   ├── production_config.py
82+
│   └── test_config.py
83+
├── forms/
84+
│   ├── base/
85+
│   │   ├── contact.py
86+
│   │   └── __init__.py
87+
│   ├── __init__.py
88+
│   └── user/
89+
│   ├── edit.py
13790
│   ├── __init__.py
138-
│   └── user/
139-
│   ├── administration.py
140-
│   ├── edit.py
141-
│   ├── __init__.py
142-
│   ├── login.py
143-
│   ├── logout.py
144-
│   ├── members.py
145-
│   └── register.py
146-
├── manage_commands/
147-
│   ├── create_database.py
148-
│   ├── create_data.py
149-
│   ├── create_superuser.py
150-
│   ├── drop_database.py
91+
│   ├── login.py
92+
│   └── register.py
93+
├── __init__.py
94+
├── models/
15195
│   ├── __init__.py
152-
│   ├── orm_test.py
153-
│   ├── run_coverage.py
154-
│   └── run_test.py
155-
└── manage.py
156-
96+
│   └── model_user.py
97+
├── static/
98+
│   ├── base.css
99+
│   └── favicon.ico
100+
├── templates/
101+
│   ├── base/
102+
│   │   ├── about.html
103+
│   │   ├── contact.html
104+
│   │   └── home.html
105+
│   ├── _base.html
106+
│   ├── errors/
107+
│   │   ├── 401.html
108+
│   │   ├── 403.html
109+
│   │   ├── 404.html
110+
│   │   └── 500.html
111+
│   ├── footer.html
112+
│   ├── header.html
113+
│   └── user/
114+
│   ├── administration.html
115+
│   ├── edit.html
116+
│   ├── login.html
117+
│   ├── members.html
118+
│   └── register.html
119+
├── tests/
120+
│   ├── base_query.py
121+
│   ├── helpers.py
122+
│   ├── __init__.py
123+
│   ├── sqlalchemy_query.py
124+
│   ├── test_config.py
125+
│   ├── test_main.py
126+
│   └── test_user.py
127+
└── views/
128+
├── base/
129+
│   ├── about.py
130+
│   ├── contact.py
131+
│   ├── home.py
132+
│   └── __init__.py
133+
├── __init__.py
134+
└── user/
135+
├── administration.py
136+
├── edit.py
137+
├── __init__.py
138+
├── login.py
139+
├── logout.py
140+
├── members.py
141+
└── register.py
157142
```
158143

159144
### Docs

0 commit comments

Comments
 (0)