Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Commit 80fb1ed

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3e02fcb commit 80fb1ed

File tree

10 files changed

+144
-148
lines changed

10 files changed

+144
-148
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.DS_Store
1+
.DS_Store

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ENV FLASK_RUN_HOST=0.0.0.0
99
# Install gcc and other dependencies
1010
RUN apk add --no-cache gcc musl-dev linux-headers
1111
# All dependencies are listed in the requirements.txt file
12-
COPY requirements.txt requirements.txt
12+
COPY requirements.txt requirements.txt
1313
# pip install is run on the entire requirements list at startup of the Docker image
1414
RUN pip install -r requirements.txt
1515
# Set or 'open' port 5000 for the container to listen on
@@ -18,4 +18,4 @@ EXPOSE 5000
1818
COPY . .
1919
COPY ./node-manager .
2020
# Set the default command for the container to "flask run"
21-
CMD ["flask", "run"]
21+
CMD ["flask", "run"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# node-manager
2-
Web app for node manager
2+
Web app for node manager
33

44
# Requirements
55

api/main.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,52 @@
22

33
# Creat an instance of the class FastAPI
44
# This will be the same instance referenced by uvicorn in the command "uvicorn main:app --reload"
5-
app=FastAPI()
5+
app = FastAPI()
66

7-
# GET
7+
8+
# GET
89
@app.get("/")
910
async def root():
10-
return {"message":"Main Page"}
11+
return {"message": "Main Page"}
1112

1213

1314
app.get("/docs")
15+
16+
1417
async def docs():
15-
return {"message":"Docs Page"}
18+
return {"message": "Docs Page"}
19+
1620

1721
app.get("/docs/jupyter")
22+
23+
1824
async def jupyterdocs():
19-
return {"message":"Jupyter Page"}
25+
return {"message": "Jupyter Page"}
2026

2127

2228
app.get("/login")
29+
30+
2331
async def login():
24-
return {"message":"Login Page"}
32+
return {"message": "Login Page"}
33+
2534

2635
app.get("/admin")
36+
37+
2738
async def admin():
28-
return {"message":"Admin Page"}
39+
return {"message": "Admin Page"}
2940

3041

3142
app.get("/catalog")
43+
44+
3245
async def catalog():
33-
return {"message":"Catalog Page"}
46+
return {"message": "Catalog Page"}
3447

35-
app.get("/weaver")
36-
async def weaver():
37-
return {"message":"Weaver Page"}
3848

49+
app.get("/weaver")
3950

4051

41-
52+
async def weaver():
53+
return {"message": "Weaver Page"}

config/__init__.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
from pyramid.config import Configurator
22

33

4-
5-
64
def main(global_config, **settings):
7-
85
# Create a 'settings file' called 'config'
96
# You can add settings to this through the Configurator functions
107
config = Configurator(settings=settings)
118

129
# Include Chameleon as a template renderer
13-
config.include('pyramid_chameleon')
10+
config.include("pyramid_chameleon")
1411

1512
# Add a route / path called home at the root
1613
# Full route / path should be /home
17-
config.add_route('home', '/')
18-
#homeURL = request.route_url('homeURL')
14+
config.add_route("home", "/")
15+
# homeURL = request.route_url('homeURL')
1916

2017
# Add a route / path called docs at /docs
21-
config.add_route('docs', '/docs')
18+
config.add_route("docs", "/docs")
2219

2320
# Add a route / path called jupyter at /docs/jupyter
24-
config.add_route('jupyter', '/docs/jupyter')
21+
config.add_route("jupyter", "/docs/jupyter")
2522

2623
# Add a route / path called weaver at the /weaver
27-
config.add_route('weaver', '/weaver')
24+
config.add_route("weaver", "/weaver")
2825

2926
# Add a route / path called catalog at /catalog
30-
config.add_route('catalog', '/catalog')
27+
config.add_route("catalog", "/catalog")
3128

3229
# Add a route / path called login at /login
33-
config.add_route('login', '/login')
30+
config.add_route("login", "/login")
3431

3532
# Add a route / path called admin at /admin
36-
config.add_route('admin', '/admin')
33+
config.add_route("admin", "/admin")
3734

38-
# Check the 'views' file for any views that have been set
39-
config.scan('.views')
35+
# Check the 'views' file for any views that have been set
36+
config.scan(".views")
4037

41-
return config.make_wsgi_app()
38+
return config.make_wsgi_app()

config/home.pt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323

2424
</body>
25-
</html>
25+
</html>

config/views.py

Lines changed: 90 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,101 @@
11
from pyramid.response import Response
22
from pyramid.view import view_config
33

4+
45
# For each view return the name of that view and the designation that will be used for links to itself and to other views
5-
@view_config(route_name='home', renderer='home.pt')
6+
@view_config(route_name="home", renderer="home.pt")
67
def home(request):
7-
8-
return {'name': 'Home View',
9-
'home':'Home',
10-
'docs':'Documentation',
11-
'jupyter':'Jupyter',
12-
'weaver':'Weaver',
13-
'catalog':'Catalog',
14-
'login':'Login',
15-
'admin':'Admin'
16-
}
17-
18-
19-
20-
@view_config(route_name='docs', renderer='home.pt')
8+
return {
9+
"name": "Home View",
10+
"home": "Home",
11+
"docs": "Documentation",
12+
"jupyter": "Jupyter",
13+
"weaver": "Weaver",
14+
"catalog": "Catalog",
15+
"login": "Login",
16+
"admin": "Admin",
17+
}
18+
19+
20+
@view_config(route_name="docs", renderer="home.pt")
2121
def docs(request):
22-
23-
return {'name': 'Documentation View',
24-
'home':'Home',
25-
'docs':'Documentation',
26-
'jupyter':'Jupyter',
27-
'weaver':'Weaver',
28-
'catalog':'Catalog',
29-
'login':'Login',
30-
'admin':'Admin'
31-
}
32-
33-
34-
@view_config(route_name='jupyter', renderer='home.pt')
22+
return {
23+
"name": "Documentation View",
24+
"home": "Home",
25+
"docs": "Documentation",
26+
"jupyter": "Jupyter",
27+
"weaver": "Weaver",
28+
"catalog": "Catalog",
29+
"login": "Login",
30+
"admin": "Admin",
31+
}
32+
33+
34+
@view_config(route_name="jupyter", renderer="home.pt")
3535
def jupyter(request):
36-
37-
return {'name': 'Jupyter View',
38-
'home':'Home',
39-
'docs':'Documentation',
40-
'jupyter':'Jupyter',
41-
'weaver':'Weaver',
42-
'catalog':'Catalog',
43-
'login':'Login',
44-
'admin':'Admin'
45-
}
46-
47-
48-
@view_config(route_name='weaver', renderer='home.pt')
36+
return {
37+
"name": "Jupyter View",
38+
"home": "Home",
39+
"docs": "Documentation",
40+
"jupyter": "Jupyter",
41+
"weaver": "Weaver",
42+
"catalog": "Catalog",
43+
"login": "Login",
44+
"admin": "Admin",
45+
}
46+
47+
48+
@view_config(route_name="weaver", renderer="home.pt")
4949
def weaver(request):
50-
51-
return {'name': 'Weaver View',
52-
'home':'Home',
53-
'docs':'Documentation',
54-
'jupyter':'Jupyter',
55-
'weaver':'Weaver',
56-
'catalog':'Catalog',
57-
'login':'Login',
58-
'admin':'Admin'
59-
}
60-
61-
62-
@view_config(route_name='catalog', renderer='home.pt')
50+
return {
51+
"name": "Weaver View",
52+
"home": "Home",
53+
"docs": "Documentation",
54+
"jupyter": "Jupyter",
55+
"weaver": "Weaver",
56+
"catalog": "Catalog",
57+
"login": "Login",
58+
"admin": "Admin",
59+
}
60+
61+
62+
@view_config(route_name="catalog", renderer="home.pt")
6363
def catalog(request):
64-
65-
return {'name': 'Catalog View',
66-
'home':'Home',
67-
'docs':'Documentation',
68-
'jupyter':'Jupyter',
69-
'weaver':'Weaver',
70-
'catalog':'Catalog',
71-
'login':'Login',
72-
'admin':'Admin'
73-
}
74-
75-
76-
77-
@view_config(route_name='login', renderer='home.pt')
64+
return {
65+
"name": "Catalog View",
66+
"home": "Home",
67+
"docs": "Documentation",
68+
"jupyter": "Jupyter",
69+
"weaver": "Weaver",
70+
"catalog": "Catalog",
71+
"login": "Login",
72+
"admin": "Admin",
73+
}
74+
75+
76+
@view_config(route_name="login", renderer="home.pt")
7877
def login(request):
79-
80-
return {'name': 'Login View',
81-
'home':'Home',
82-
'docs':'Documentation',
83-
'jupyter':'Jupyter',
84-
'weaver':'Weaver',
85-
'catalog':'Catalog',
86-
'login':'Login',
87-
'admin':'Admin'
88-
}
89-
90-
91-
@view_config(route_name='admin', renderer='home.pt')
78+
return {
79+
"name": "Login View",
80+
"home": "Home",
81+
"docs": "Documentation",
82+
"jupyter": "Jupyter",
83+
"weaver": "Weaver",
84+
"catalog": "Catalog",
85+
"login": "Login",
86+
"admin": "Admin",
87+
}
88+
89+
90+
@view_config(route_name="admin", renderer="home.pt")
9291
def admin(request):
93-
94-
return {'name': 'Admin View',
95-
'home':'Home',
96-
'docs':'Documentation',
97-
'jupyter':'Jupyter',
98-
'weaver':'Weaver',
99-
'catalog':'Catalog',
100-
'login':'Login',
101-
'admin':'Admin'
102-
}
92+
return {
93+
"name": "Admin View",
94+
"home": "Home",
95+
"docs": "Documentation",
96+
"jupyter": "Jupyter",
97+
"weaver": "Weaver",
98+
"catalog": "Catalog",
99+
"login": "Login",
100+
"admin": "Admin",
101+
}

development.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ listen = localhost:6543
1919

2020
# Run/deploy by using pserve to run the ini file
2121
# $VENV/bin/pserve development.ini --reload
22-
# Check browser
22+
# Check browser

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ flask
22
redis
33
fastapi
44
pyramid==2.0.1
5-
waitress
5+
waitress

0 commit comments

Comments
 (0)