backup
This commit is contained in:
1 parent
d88c383df2
commit
d44dc783ee
5 files changed
+113
-38
No files matched your search
+15
@@ -0,0 +1,15 @@
|
||||
from flask import Flask, render_template, url_for, request, redirect
|
||||
from datetime import datetime
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.route('/', methods=['POST', 'GET'])
|
||||
def index():
|
||||
if request.method == 'POST':
|
||||
return 'There was an issue adding your task'
|
||||
else:
|
||||
return render_template('index.html')
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
+8
-38
@@ -25,57 +25,27 @@ class SubModule(DirectoryItem):
|
||||
|
||||
class Project(DirectoryItem):
|
||||
pass
|
||||
# def __init__(self,rootDir,name) -> None:
|
||||
# self.name = name
|
||||
# self.path = os.path.join(rootDir,name)
|
||||
# self.itemList = []
|
||||
# sList = os.listdir(self.path)
|
||||
# for p in sList:
|
||||
# self.itemList.append(SubModule(self.path,p))
|
||||
# pass
|
||||
# def print(self):
|
||||
# print(self.path)
|
||||
# for i in self.itemList:
|
||||
# i.print();
|
||||
|
||||
class Projects(DirectoryItem):
|
||||
# def __init__(self, rootDir) -> None:
|
||||
# self.itemList = []
|
||||
# self.path = rootDir
|
||||
# pList = os.listdir(self.path)
|
||||
# for p in pList:
|
||||
# self.itemList.append(Project(self.path,p))
|
||||
# pass
|
||||
# def print(self):
|
||||
# print(self.path)
|
||||
# for i in self.itemList:
|
||||
# i.print();
|
||||
# pass
|
||||
pass
|
||||
|
||||
|
||||
|
||||
rootdir = './Projects'
|
||||
# projects = os.listdir(rootdir);
|
||||
# modules = [];
|
||||
# firmwares = [];
|
||||
# for project in projects:
|
||||
# modules.append(os.listdir(os.path.join(rootdir,project)));
|
||||
|
||||
|
||||
# print(modules);
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
# def test():
|
||||
# rootdir = './Projects'
|
||||
# projects = os.listdir(rootdir);
|
||||
# print(projects);
|
||||
|
||||
@app.route("/")
|
||||
def hello_world():
|
||||
return "<p>Hello, World!</p>"
|
||||
|
||||
def main():
|
||||
p = Projects(rootdir,"")
|
||||
p.print()
|
||||
# p = Projects(rootdir,"")
|
||||
# p.print()
|
||||
app.run()
|
||||
pass;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
body, html {
|
||||
margin: 0;
|
||||
font-family: sans-serif;
|
||||
background-color: lightblue;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 0 auto;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
table, td, th {
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
th {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
td {
|
||||
text-align: center;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.form {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 70%;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
{% extends 'base.html' %} {% block head %}
|
||||
<title>Anka Anvil</title>
|
||||
{% endblock %} {% block body %}
|
||||
<div class="content">
|
||||
<h3 style="text-align: center">Please choose an application below</h3>
|
||||
<ul>
|
||||
<li>Flash Firmware</li>
|
||||
<li>Create PCB Panel</li>
|
||||
</ul>
|
||||
<!-- <h1 style="text-align: center">Task Master</h1>
|
||||
{% if tasks|length < 1 %}
|
||||
<h4 style="text-align: center">There are no tasks. Create one below!</h4>
|
||||
{% else %}
|
||||
<table>
|
||||
<tr>
|
||||
<th>Task</th>
|
||||
<th>Added</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
{% for task in tasks %}
|
||||
<tr>
|
||||
<td>{{ task.content }}</td>
|
||||
<td>{{ task.date_created.date() }}</td>
|
||||
<td>
|
||||
<a href="/delete/{{task.id}}">Delete</a>
|
||||
<br>
|
||||
<a href="/update/{{task.id}}">Update</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<div class="form">
|
||||
<form action="/" method="POST">
|
||||
<input type="text" name="content" id="content">
|
||||
<input type="submit" value="Add Task">
|
||||
</form>
|
||||
</div> -->
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user