todo script finalized

This commit is contained in:
Norm Rasmussen
2022-10-26 16:09:10 -04:00
parent 36ab0e9086
commit 1535e7a3f1
9 changed files with 56 additions and 24 deletions

View File

@ -199,10 +199,10 @@ These are new notes to test an update function
- [X] Move Contact to the bottom: Contact, Profile Settings, Sign out
- [X] Rider App
- [X] Add Language Buttons such as in Canva (top right)
* [ ] This is a task
* [ ] This is another task
* [ ] This is a sub task!
* [ ] Here is another task.
* [ ] This is a task #1
* [ ] This is another task #2
* [ ] This is a sub task! #3
* [ ] Here is another task. #4
### Notes

View File

@ -77,6 +77,7 @@ How do we differentiate from "all"?
For Americas, LatAm, Canada, and USA might have different courses
This is ONLY for the US
## 10/03/2022
* [-] CREATE a storyboard PPT of the UX of the academy
* [ ] Remove all links along the top of the footer

View File

@ -1,4 +0,0 @@
* [ ] (Flink) [10/25/2022]This is a task
* [ ] (Flink) [10/25/2022]This is another task
* [ ] (Flink) [10/25/2022][ ] This is a sub task!
* [ ] (Flink) [10/25/2022]Here is another task.

0
Scripts/TodoMD/Todos.md Normal file
View File

View File

@ -1,14 +1,24 @@
import io
import markdown
import sys
from re import search
import re
import os
import fileinput
from datetime import date
#rootdir = "/Users/normrasmussen/Documents/Northpass/CustomerNotes/"
# This is for testing
rootdir = "/Users/normrasmussen/Documents/Northpass/Scripts/Confluence_Notes/SampleNotes/"
rootdir = "/Users/normrasmussen/Documents/Northpass/CustomerNotes/"
input = sys.argv[1]
company = input.split("/")[6]
print(company)
def findCompany(rootdir):
#def parsefromVim(rootdir, input):
# path = input.split("/")
# company = path[7]
# findcompany(rootdir, company)
def findCompany(rootdir, company):
files = os.listdir(rootdir)
for fileName in files:
if fileName.startswith(".") or fileName.startswith("Todos"):
@ -19,29 +29,32 @@ def findCompany(rootdir):
def findTodos(rootdir, company):
todos = []
with open(rootdir + company + ".md", "r") as currentfile:
with open(rootdir + company, "r") as currentfile:
file = currentfile.readlines()
for fullTasks in file:
if "* [ ] " in fullTasks:
tasks = fullTasks[6:]
tasks = fullTasks
deleteTasks(rootdir, company, tasks)
todos.append(tasks)
writeTasks(rootdir, company, todos)
writeTasks(rootdir, company, todos)
def writeTasks(rootdir, company, todos):
today = date.today()
currentDate = today.strftime("%m/%d/%Y")
with open(rootdir + "Todos.md", "w") as taskFile:
company = company[:-3]
todoDir = "/Users/normrasmussen/Documents/Northpass/"
with open(todoDir + "Todos.md", "a") as taskFile:
for singleTask in todos:
taskFile.write("* [ ] (" + company + ") " + "[" + currentDate + "]" + singleTask)
# deleteTasks(rootdir, company)
task = singleTask.rsplit("* [ ] ")[1]
taskFile.write("* [ ] (" + company + ") " + "[" + currentDate + "] " + task)
def deleteTasks(rootdir, company, todos):
with open(rootdir + company, "r") as input:
with open(rootdir + company, "w") as currentfile:
for task in input:
if task.strip("\n") != todos:
currentfile.write(task)
def deleteTasks(rootdir, company, tasks):
file = rootdir + company
for line in fileinput.input(file, inplace=1):
if tasks in line:
line = line.replace(tasks, '')
sys.stdout.write(line)
if __name__ == "__main__":
findCompany(rootdir)
findTodos(rootdir, company)