########
# MAIN #
########

# get token
token = panoptesPythonAPI.get_bearer_token("mkosmala", "hard2guess")

# create a project for simple workflows
# check to see if it's already created. if not, create it
projid = panoptesPythonAPI.get_projectid_from_projectname(
    project, "mkosmala", token)
if projid == -1:
    print "Creating project: " + project
    project_info = build_project_info()
    projid = panoptesPythonAPI.create_user_project(project_info, token)
else:
    print "Project already exists"
    exit(0)

print "   ID: " + projid

# add collaborators
#add_collaborators(projid,token)

# add workflows
create_workflows(projid, token)

# add subject sets
create_subject_sets_and_subjects(projid, token)
# get token
with open(auth,'r') as authfile:
    areader = csv.reader(authfile,delimiter=',')
    row = areader.next()
    username = row[0]
    password = row[1]

token = panoptesPythonAPI.get_bearer_token(username,password)

# create a project for simple workflows
# check to see if it's already created. if not, create it
projid_simp = panoptesPythonAPI.get_projectid_from_projectname(project_simple,username,token)
if projid_simp==-1:
    print "Creating project: " + project_simple
    project_info = build_project_info("simple")
    projid_simp = panoptesPythonAPI.create_user_project(project_info,token)
else:
    print "Project already exists: " + project_simple
    exit(0)    
print "   ID: " + projid_simp

# create a project for complex workflows
# check to see if it's already created. if not, create it
projid_comp = panoptesPythonAPI.get_projectid_from_projectname(project_complex,username,token)
if projid_comp==-1:
    print "Creating project: " + project_complex
    project_info = build_project_info("complex")
    projid_comp = panoptesPythonAPI.create_user_project(project_info,token)
else:
    print "Project already exists: " + project_complex
    exit(0)    
Ejemplo n.º 3
0
with open(auth, 'r') as authfile:
    areader = csv.reader(authfile, delimiter=',')
    row = areader.next()
    username = row[0]
    password = row[1]

token = panoptesPythonAPI.get_bearer_token(username, password)

# create a project for simple workflows
# check to see if it's already created. if not, create it
projid_simp = panoptesPythonAPI.get_projectid_from_projectname(
    project_simple, username, token)
if projid_simp == -1:
    print "Creating project: " + project_simple
    project_info = build_project_info("simple")
    projid_simp = panoptesPythonAPI.create_user_project(project_info, token)
else:
    print "Project already exists: " + project_simple
    exit(0)
print "   ID: " + projid_simp

# create a project for complex workflows
# check to see if it's already created. if not, create it
projid_comp = panoptesPythonAPI.get_projectid_from_projectname(
    project_complex, username, token)
if projid_comp == -1:
    print "Creating project: " + project_complex
    project_info = build_project_info("complex")
    projid_comp = panoptesPythonAPI.create_user_project(project_info, token)
else:
    print "Project already exists: " + project_complex
Ejemplo n.º 4
0
# see if project already exists and get project id
# NOT YET
#projid = panoptesPythonAPI.get_projectid_from_projectname(project,token)
projid = 64

# if the group project doesn't exist, create it
#if projid==-1:
#    projid = panoptesPythonAPI.create_group_project(grpid,
#                                                    project,
#                                                    "A crazy and silly project",
#                                                    token)

# if the user project doesn't exist, create it
if projid==-1:
    projid = panoptesPythonAPI.create_user_project(project,
                                                "A crazy and silly project",
                                                token)


# create a workflow
# NOT YET
#workflowid = panoptesPythonAPI.create_workflow(token)

# create a subject
meta = """  "Site": "Harvard Forest",
            "Vegetation": "Deciduous Broadleaf Forest",
            "Latitude": "42.5378",
            "Longitude": "-72.1715",
            "Elevation": "340",
            "Camera": "StarDot NetCam SC",
            "Date": "2014-06-03",
Ejemplo n.º 5
0
# see if project already exists and get project id
# NOT YET
#projid = panoptesPythonAPI.get_projectid_from_projectname(project,token)
projid = 64

# if the group project doesn't exist, create it
#if projid==-1:
#    projid = panoptesPythonAPI.create_group_project(grpid,
#                                                    project,
#                                                    "A crazy and silly project",
#                                                    token)

# if the user project doesn't exist, create it
if projid == -1:
    projid = panoptesPythonAPI.create_user_project(
        project, "A crazy and silly project", token)

# create a workflow
# NOT YET
#workflowid = panoptesPythonAPI.create_workflow(token)

# create a subject
meta = """  "Site": "Harvard Forest",
            "Vegetation": "Deciduous Broadleaf Forest",
            "Latitude": "42.5378",
            "Longitude": "-72.1715",
            "Elevation": "340",
            "Camera": "StarDot NetCam SC",
            "Date": "2014-06-03",
            "Time": "12:01:38" """
#subjid = panoptesPythonAPI.create_subject(projid,meta,"test.jpg",token)

########
# MAIN #
########

# get token
token = panoptesPythonAPI.get_bearer_token("mkosmala","hard2guess")

# create a project for simple workflows
# check to see if it's already created. if not, create it
projid = panoptesPythonAPI.get_projectid_from_projectname(project,"mkosmala",token)
if projid==-1:
    print "Creating project: " + project
    project_info = build_project_info()
    projid = panoptesPythonAPI.create_user_project(project_info,token)
else:
    print "Project already exists"
    exit(0)
    
print "   ID: " + projid 

# add collaborators
#add_collaborators(projid,token)

# add workflows
create_workflows(projid,token)

# add subject sets
create_subject_sets_and_subjects(projid,token)