def create_workflows(projid,token):
    workflows = os.listdir(workflow_dir)

    # load in each workflow
    for wf in workflows:

        wf_path = workflow_dir + wf
        with open(wf_path,'r') as wffile:
            workflow = wffile.read().replace('\n', '')

            wfname = wf.split('.')[0]

            # and build it
            print "Building workflow: " + wfname
            panoptesPythonAPI.create_workflow(projid,wfname,workflow,token)

    return
def create_workflows(projid, token):
    workflows = os.listdir(workflow_dir)

    # load in each workflow
    for wf in workflows:

        wf_path = workflow_dir + wf
        with open(wf_path, 'r') as wffile:
            workflow = wffile.read().replace('\n', '')

            wfname = wf.split('.')[0]

            # and build it
            print "Building workflow: " + wfname
            wfid = panoptesPythonAPI.create_workflow(projid, wfname, workflow,
                                                     token)
            print "   ID: " + wfid

    return
Beispiel #3
0
def create_workflows(projids, token):
    #workflows = os.listdir(workflow_dir)
    with open(linkfile, 'r') as lfile:

        # discard header
        lfile.readline()

        # keep track of workflows already done
        donewf = []

        # go through each line
        lreader = csv.reader(lfile, delimiter=',', quotechar='\"')
        for row in lreader:

            wfname = row[0]
            wfset = row[2]

            # do new workflows
            if wfname not in donewf:

                wf_path = workflow_dir + wfname + ".txt"
                with open(wf_path, 'r') as wffile:
                    workflow = wffile.read().replace('\n', '')

                # add this workflow to the correct project
                wfproj = projids[0]
                if wfset == "complex":
                    wfproj = projids[1]

                # and build it
                print "Building workflow " + wfname + " in project " + wfproj
                wfid = panoptesPythonAPI.create_workflow(
                    wfproj, wfname, workflow, token)
                print "   ID: " + wfid

                # record that we've done this workflow
                donewf.append(wfname)

    return
def create_workflows(projids,token):
    #workflows = os.listdir(workflow_dir)
    with open(linkfile,'r') as lfile:

        # discard header
        lfile.readline()

        # keep track of workflows already done
        donewf = []

        # go through each line
        lreader = csv.reader(lfile,delimiter=',',quotechar='\"')
        for row in lreader:

            wfname = row[0]
            wfset = row[2]

            # do new workflows
            if wfname not in donewf:

                wf_path = workflow_dir + wfname + ".txt"
                with open(wf_path,'r') as wffile:
                    workflow = wffile.read().replace('\n', '')

                # add this workflow to the correct project
                wfproj = projids[0]
                if wfset == "complex":
                    wfproj = projids[1]
                        
                # and build it
                print "Building workflow " + wfname + " in project " + wfproj
                wfid = panoptesPythonAPI.create_workflow(wfproj,wfname,workflow,token)
                print "   ID: " + wfid

                # record that we've done this workflow
                donewf.append(wfname)

    return
Beispiel #5
0
                "required": "1"
            },
            "flowers": {
                "type": "single",
                "question": "Are there flowers visible?",
                "answers": [
                    {"value": "yes", "label": "Yes"},
                    {"value": "no", "label": "No"}
                ],
                "required": "1"
            }
        },
        "first_task": "valid_image",
        "primary_language": "en-us",
        "links": {
            "project": \"""" + str(projid) + """\",
            "subject_sets": [\"""" + str(subj_set_id) + """\"]
        }
    }
}"""


workflow_id = panoptesPythonAPI.create_workflow(workflow,token)

print workflow_id

#57
    


Beispiel #6
0
                "answers": [
                    {"value": "yes", "label": "Yes", "next": "flowers"},
                    {"value": "no", "label": "No", "next": null}
                ],
                "required": "1"
            },
            "flowers": {
                "type": "single",
                "question": "Are there flowers visible?",
                "answers": [
                    {"value": "yes", "label": "Yes"},
                    {"value": "no", "label": "No"}
                ],
                "required": "1"
            }
        },
        "first_task": "valid_image",
        "primary_language": "en-us",
        "links": {
            "project": \"""" + str(projid) + """\",
            "subject_sets": [\"""" + str(subj_set_id) + """\"]
        }
    }
}"""

workflow_id = panoptesPythonAPI.create_workflow(workflow, token)

print workflow_id

#57