Пример #1
0
def start(tournament):
    """Start a tournament, opening up matches for score reporting.

    The tournament must have at least 2 participants.

    """
    api.fetch("POST", "tournaments/start/%s" % tournament)
Пример #2
0
def update(tournament, participant_id, **params):
    """Update the attributes of a tournament participant."""
    api.fetch(
        "PUT",
        "tournaments/%s/participants/%s" % (tournament, participant_id),
        "participant",
        **params)
Пример #3
0
def publish(tournament):
    """Publish a tournament, making it publically accessible.

     The tournament must have at least 2 participants.

     """
    api.fetch("POST", "tournaments/publish/%s" % tournament)
Пример #4
0
def destroy(tournament):
    """Deletes a tournament along with all its associated records.

    There is no undo, so use with care!

    """
    api.fetch("DELETE", "tournaments/%s" % tournament)
Пример #5
0
def publish(tournament):
    """Publish a tournament, making it publically accessible.

     The tournament must have at least 2 participants.

     """
    api.fetch("POST", "tournaments/publish/%s" % tournament)
Пример #6
0
def update(tournament, match_id, **params):
    """Update/submit the score(s) for a match."""
    api.fetch(
        "PUT",
        "tournaments/%s/matches/%s" % (tournament, match_id),
        "match",
        **params)
Пример #7
0
def start(tournament):
    """Start a tournament, opening up matches for score reporting.

    The tournament must have at least 2 participants.

    """
    api.fetch("POST", "tournaments/start/%s" % tournament)
Пример #8
0
def update(tournament, match, attachment, **params):
    """Update the attributes of a match attachment."""
    api.fetch(
        "PUT",
        "tournaments/%s/matches/%s/attachments/%s" % (tournament, match, attachment),
        "match_attachment",
        **params)
Пример #9
0
def randomize(tournament):
    """Randomize seeds among participants.

    Only applicable before a tournament has started.

    """
    api.fetch("POST", "tournaments/%s/participants/randomize" % tournament)
Пример #10
0
def update(tournament, participant_id, **params):
    """Update the attributes of a tournament participant."""
    api.fetch(
        "PUT",
        "tournaments/%s/participants/%s" % (tournament, participant_id),
        "participant",
        **params)
Пример #11
0
def randomize(tournament):
    """Randomize seeds among participants.

    Only applicable before a tournament has started.

    """
    api.fetch("POST", "tournaments/%s/participants/randomize" % tournament)
Пример #12
0
def destroy(tournament):
    """Deletes a tournament along with all its associated records.

    There is no undo, so use with care!

    """
    api.fetch("DELETE", "tournaments/%s" % tournament)
Пример #13
0
def reset(tournament):
    """Reset a tournament, clearing all of its scores and attachments.

    You can then add/remove/edit participants before starting the
    tournament again.

    """
    api.fetch("POST", "tournaments/reset/%s" % tournament)
Пример #14
0
def reset(tournament):
    """Reset a tournament, clearing all of its scores and attachments.

    You can then add/remove/edit participants before starting the
    tournament again.

    """
    api.fetch("POST", "tournaments/reset/%s" % tournament)
Пример #15
0
def process_check_ins(tournament):
    """This should be invoked after a tournament's
    check-in window closes before the tournament is started.

    1) Marks participants who have not checked in as inactive.
    2) Moves inactive participants to bottom seeds (ordered by original seed).
    3) Transitions the tournament state from 'checking_in' to 'checked_in'

    """
    api.fetch("POST", "tournaments/%s/process_check_ins")
Пример #16
0
def abort_check_in(tournament):
    """When your tournament is in a 'checking_in' or 'checked_in' state,
    there's no way to edit the tournament's start time (start_at)
    or check-in duration (check_in_duration).
    You must first abort check-in, then you may edit those attributes.

    1) Makes all participants active and clears their checked_in_at times.
    2) Transitions the tournament state from 'checking_in' or 'checked_in' to 'pending'

    """
    api.fetch("POST", "tournaments/%s/abort_check_in")
Пример #17
0
def destroy(tournament, participant_id):
    """Destroys or deactivates a participant.

    If tournament has not started, delete a participant, automatically
    filling in the abandoned seed number.

    If tournament is underway, mark a participant inactive, automatically
    forfeiting his/her remaining matches.

    """
    api.fetch("DELETE",
              "tournaments/%s/participants/%s" % (tournament, participant_id))
Пример #18
0
def destroy(tournament, participant_id):
    """Destroys or deactivates a participant.

    If tournament has not started, delete a participant, automatically
    filling in the abandoned seed number.

    If tournament is underway, mark a participant inactive, automatically
    forfeiting his/her remaining matches.

    """
    api.fetch(
        "DELETE",
        "tournaments/%s/participants/%s" % (tournament, participant_id))
Пример #19
0
def mark_as_underway(tournament, match_id):
    """Sets "underway_at" to the current time and highlights the match in the bracket"""
    api.fetch(
        "POST",
        "tournaments/%s/matches/%s/mark_as_underway" % (tournament, match_id))
Пример #20
0
def update(tournament, **params):
    """Update a tournament's attributes."""
    api.fetch("PUT", "tournaments/%s" % tournament, "tournament", **params)
Пример #21
0
def finalize(tournament):
    """Finalize a tournament that has had all match scores submitted
       rendering its results permanent.
    """
    api.fetch("POST", "tournaments/finalize/%s" % tournament)
Пример #22
0
def undo_check_in(tournament, participant_id):
    """Marks a participant as having not checked in."""
    api.fetch(
        "POST",
        "tournaments/%s/participants/%s/undo_check_in" % (tournament, participant_id))
Пример #23
0
def check_in(tournament, participant_id):
    """Checks a participant in."""
    api.fetch(
        "POST",
        "tournaments/%s/participants/%s/check_in" % (tournament, participant_id))
Пример #24
0
def finalize(tournament):
    """Finalize a tournament that has had all match scores submitted
       rendering its results permanent.
    """
    api.fetch("POST", "tournaments/finalize/%s" % tournament)
Пример #25
0
def destroy(tournament, match, attachment):
    """Delete a match attachment."""
    api.fetch(
        "DELETE",
        "tournaments/%s/matches/%s/attachments/%s" % (tournament, match, attachment))
Пример #26
0
def reopen(tournament, match_id):
    """Reopens a match that was marked completed, automatically resetting matches that follow it."""
    api.fetch(
        "POST",
        "tournaments/%s/matches/%s/reopen" % (tournament, match_id))
Пример #27
0
def update(tournament, **params):
    """Update a tournament's attributes."""
    api.fetch("PUT", "tournaments/%s" % tournament, "tournament", **params)
Пример #28
0
def bulk_add(tournament, **params):
    # example:  api.fetch(method='POST', uri=uri,json=True, data='{"participants": [{"name": "test1"}, {"name": "test2"}]}')
    api.fetch("POST",
              "tournaments/%s/participants/bulk_add" % tournament,
              json=True,
              **params)
Пример #29
0
def update(tournament, match_id, **params):
    """Update/submit the score(s) for a match."""
    api.fetch("PUT", "tournaments/%s/matches/%s" % (tournament, match_id),
              "match", **params)
Пример #30
0
def reopen(tournament, match_id):
    """Reopens a match that was marked completed, automatically resetting matches that follow it."""
    api.fetch("POST",
              "tournaments/%s/matches/%s/reopen" % (tournament, match_id))
Пример #31
0
def check_in(tournament, participant_id):
    """Checks a participant in."""
    api.fetch(
        "POST",
        "tournaments/%s/participants/%s/check_in" % (tournament, participant_id))
Пример #32
0
def unmark_as_underway(tournament, match_id):
    """Clears "underway_at" and unhighlights the match in the bracket"""
    api.fetch(
        "POST", "tournaments/%s/matches/%s/unmark_as_underway" %
        (tournament, match_id))
Пример #33
0
def undo_check_in(tournament, participant_id):
    """Marks a participant as having not checked in."""
    api.fetch(
        "POST",
        "tournaments/%s/participants/%s/undo_check_in" % (tournament, participant_id))