Welcome to damn_server’s documentation!

Developer Reference

api.py

Web app serving JSON API.

area.py

Area related procedures.

exception damn_server.area.BadAIDError
exception damn_server.area.BadFeatureCollectionError
exception damn_server.area.BadJSONFormatError
exception damn_server.area.MissingAuthorError
exception damn_server.area.MissingDescriptionError
exception damn_server.area.MissingFeatureCollectionError
exception damn_server.area.MissingInstructionsError
exception damn_server.area.MissingPriorityError
exception damn_server.area.MissingTagsError
exception damn_server.area.NoSquareToMapError
exception damn_server.area.NoSquareToReviewError
exception damn_server.area.UnknownLockingPolicyError
async damn_server.area.commits(aid=None)

Return tuple of commits of aid area.

Keyword arguments: aid – Area identifier.

async damn_server.area.load(aid)

Return JSON area loaded from database.

Keyword arguments: aid – Area identifier.

async damn_server.area.map(aid=None, author=None, what='recent')

Lock what square for mapping, return its sid.

author is display_name of mapper. what can be random, recent, or recentmine, where random locks random square, recent locks recent square, and recentmine locks recent square that author has been working on.

Keyword arguments: aid – Area identifier. author – Whose author’s squares? what – Decide locking policy.

async damn_server.area.review(aid=None, author=None, what='recent')

Lock what square for review.

author is display_name of mapper. what can be random, recent, or recentmine, where random locks random square, recent locks recent square, and recentmine locks recent square that author has been working on.

Keyword arguments: aid – Area identifier. author – Whose author’s squares? what – Decide locking policy.

async damn_server.area.save(area, author)

Save area to database, return area identifier aid.

Create area from area and save to current_areas table. Also, create squares based on area["featurecollection"] and save them to current_squares.

Keyword arguments: area – JSON area to save. author – Author of new area.

async damn_server.area.stats(aid=None)

Return area statistics.

Keyword arguments: aid – Area identifier.

async damn_server.area.update(area=None, author=None)

Update area in database.

Keyword arguments: area – Part of JSON area to save. author – Author of the update.

areas.py

Areas related procedures.

async damn_server.areas.thinlist()

Return list of shorted area information.

conf.py

Configuration constants.

db.py

Database related procedures.

async damn_server.db.init_pool()

Initialize asyncpg pool.

square.py

Square related procedures.

exception damn_server.square.BadAIDError
exception damn_server.square.BadSIDError
exception damn_server.square.MissingAIDError
exception damn_server.square.MissingAuthorError
exception damn_server.square.MissingSIDError
async damn_server.square.border(aid=None, sid=None)

Return border geometry of square as GeoJSON polygon.

Keyword arguments: aid – Area identifier. sid – Square identifier.

async damn_server.square.commit(c=None)

Save commit c to database.

Keyword arguments: c – Commit to store.

async damn_server.square.commits(aid=None, sid=None)

Return commits for square sid in area aid.

Keyword arguments: aid – Area identifier. sid – Square identifier.

async damn_server.square.last_commit(aid=None, sid=None)

Return last commit of square sid in area aid.

Keyword arguments: aid – Area identifier. sid – Square identifier.

async damn_server.square.split(aid=None, sid=None, author=None)

Split square sid to four smaller squares.

Keyword arguments: aid – Area identifier. sid – Square identifier. author – The author of the split.

user.py

User related procedures.

async damn_server.user.load(dn=None)

Load user with display name dn from database.

Keyword arguments: dn – Display name of the user.

async damn_server.user.locked_square(author=None)

Return the last locked square by author.

If such square does not exists, return False.

Keyword arguments: author – Author of the square lock commit.

async damn_server.user.save(u=None)

Save user u to database.

Keyword arguments: u – JSON object with user’s information.

async damn_server.user.update(u=None)

Update user u in database.

Keyword arguments: u – The user to update.

async damn_server.user.workingon(author=None)

Return list of squares commits that author is working on.

Keyword arguments: author – Author of the commits.