Skip to content

Commit 720625a

Browse files
authored
Merge pull request #54 from aledruetta/master
UPDATE
2 parents 558a459 + f3abca5 commit 720625a

Some content is hidden

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

95 files changed

+10767
-64
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
venv/
2-
.venv/
1+
venv*/
2+
.venv*/
33
.vscode/
4+
.vagrant/
45
__pycache__/
56
*.sw[pon]
67
requirements-dev.txt
78
*.db*
89
.eslintrc.*
910
node_modules/
11+
*.log
12+
*.egg-info/

proj09-sqlite3/.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
indent_style = space
12+
charset = utf-8
13+
14+
[*.py]
15+
indent_size = 4
16+
17+
[*.{css,html,js,json,yml}]
18+
indent_size = 2

proj09-sqlite3/.pylintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[MASTER]
2+
disable=
3+
C0114, # missing-module-docstring
4+
C0115, # missing-class-docstring
5+
C0116, # missing-function-docstring
6+
E1101, # instance has no member

proj09-sqlite3/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SHELL := /bin/bash
2+
3+
run:
4+
FLASK_APP=projeto/app FLASK_ENV=development flask run
5+
6+
install:
7+
# python3 -m venv .venv
8+
# source .venv/bin/activate
9+
pip install -r requirements.txt
10+
pip install -r requirements-dev.txt
11+
12+
clean:
13+
rm -rf .venv

proj09-sqlite3/package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proj09-sqlite3/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "prototipo",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "projeto/static/script.js",
6+
"dependencies": {
7+
"font-awesome": "^4.7.0"
8+
},
9+
"devDependencies": {},
10+
"scripts": {
11+
"test": "echo \"Error: no test specified\" && exit 1"
12+
},
13+
"author": "",
14+
"license": "ISC"
15+
}

proj09-sqlite3/projeto/__init__.py

Whitespace-only changes.

proj09-sqlite3/projeto/app.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from datetime import timedelta
2+
from flask import Flask
3+
4+
from .ext import auth, api, db, jwt, site
5+
6+
7+
def create_app():
8+
app = Flask(__name__)
9+
10+
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///test.db"
11+
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
12+
app.config["SECRET_KEY"] = "super-secret-key"
13+
app.config["JWT_AUTH_USERNAME_KEY"] = "email"
14+
app.config["JWT_AUTH_URL_RULE"] = "/token"
15+
app.config["JWT_EXPIRATION_DELTA"] = timedelta(seconds=3600)
16+
17+
db.init_app(app)
18+
api.init_app(app)
19+
jwt.init_app(app)
20+
auth.init_app(app)
21+
site.init_app(app)
22+
23+
return app

proj09-sqlite3/projeto/ext/__init__.py

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from flask_restful import Api
2+
3+
from .views import (ApiEstacao, ApiEstacaoId, ApiEstacaoIdSensor,
4+
ApiEstacaoIdSensorId, ApiSensorIdParam,
5+
ApiSensorIdParamLast)
6+
7+
api = Api()
8+
api.add_resource(ApiEstacao, "/api/v1.1/estacao")
9+
api.add_resource(ApiEstacaoId, "/api/v1.1/estacao/<int:estacao_id>")
10+
api.add_resource(ApiEstacaoIdSensor,
11+
"/api/v1.1/estacao/<int:estacao_id>/sensor")
12+
api.add_resource(ApiEstacaoIdSensorId,
13+
"/api/v1.1/estacao/<int:estacao_id>/sensor/<int:sensor_id>")
14+
api.add_resource(ApiSensorIdParam,
15+
"/api/v1.1/sensor/<int:sensor_id>/<string:param>")
16+
api.add_resource(ApiSensorIdParamLast,
17+
"/api/v1.1/sensor/<int:sensor_id>/<string:param>/last")
18+
19+
20+
def init_app(app):
21+
api.init_app(app)

0 commit comments

Comments
 (0)