Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Call MakoCRUD functionalityies inside bin/mako #3

Open
fantastic001 opened this issue Jul 12, 2022 · 0 comments
Open

Call MakoCRUD functionalityies inside bin/mako #3

fantastic001 opened this issue Jul 12, 2022 · 0 comments
Assignees

Comments

@fantastic001
Copy link
Owner

Right now we access database directly in bin/mako instead of calling mako/lib/MakoCRUD.py functions

For instance:

def list_tasks(project_name, name, only_todo=False, **kw):
    introduce("Task list for %s -> %s" % (project_name, name))
    projects = db.downloadProjects()
    i = get_project_index(projects, project_name)
    if i == -1:
        log.print("Project not found")
        return 
    j = get_subproject_index(projects[i].getSubprojects(), name)
    if j == -1:
        log.print("Subproject not found")
        return 
    sp: ScheduleSubproject = projects[i].getSubprojects()[j]
    for field in sp.getFieldList():
        print("######### %s ###########" % field)
        print(sp.getField(field))
    tasks = sp.getAllTasks()
    k = 1
    for t in tasks:
        if only_todo:
            if not t.isDone():
                log.task(t,k)
        else:
            log.task(t, k)
        k += 1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants