PyPi to follow...
On your local machine:
./setup.py install
Only Superusers can create new Projects on the server.
s = Server()
p = Project()
p.name = "New Project"
p.post(s)
s = Server()
p = Project(id)
p.retrieve(s)
s = Server()
p = Project(id)
p.get(s)
p.name = "Modified Name"
p.put(s)
Only Superusers can delete Projects on the server.
s = Server()
p = Project(id)
p.delete(s)
Each Challenge needs a valid parent Project
s = Server()
p = Project(id)
p.get(s)
c = Challenge(id)
c.name = "New Challenge"
c.parent = p
c.post(s)
s = Server()
c = Challenge(id)
c.retrieve(s)
s = Server()
c = Challenge(id)
c.get(s)
c.name = "Modified Name"
c.put(s)
This will also delete all child tasks!
s = Server()
c = Challenge(id)
c.delete(s)
s = Server()
c = Challenge(id)
c.get(s)
t = Task()
t.instruction = "Solve this please"
t.parent = c
t.location = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [
-98.4375,
39.095962936305476
]
}
}
]
}
t.post(s)
s = Server()
t = Task(id)
t.retrieve(s)
s = Server()
t = Task(id)
t.get(s)
t.instruction = "Modified Instruction"
t.put(s)
s = Server()
t = Task(id)
t.delete(s)
export MR_API_KEY=your_api_key && ./test_maproulette.py