コード例 #1
0
ファイル: tournaments.py プロジェクト: AJAnderson/pychallonge
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
ファイル: tournaments.py プロジェクト: AJAnderson/pychallonge
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
ファイル: matches.py プロジェクト: maxwasserman/pychallonge
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
ファイル: participants.py プロジェクト: rookes/pychallonge
def randomize(tournament):
    """Randomize seeds among participants.

    Only applicable before a tournament has started.

    """
    api.fetch("POST", "tournaments/%s/participants/randomize" % tournament)
コード例 #10
0
ファイル: participants.py プロジェクト: ZEDGR/pychallonge
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
ファイル: participants.py プロジェクト: ZEDGR/pychallonge
def randomize(tournament):
    """Randomize seeds among participants.

    Only applicable before a tournament has started.

    """
    api.fetch("POST", "tournaments/%s/participants/randomize" % tournament)
コード例 #12
0
ファイル: tournaments.py プロジェクト: AJAnderson/pychallonge
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
ファイル: tournaments.py プロジェクト: AJAnderson/pychallonge
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
ファイル: tournaments.py プロジェクト: ZEDGR/pychallonge
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
ファイル: tournaments.py プロジェクト: ZEDGR/pychallonge
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
ファイル: participants.py プロジェクト: rookes/pychallonge
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
ファイル: participants.py プロジェクト: ZEDGR/pychallonge
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
ファイル: tournaments.py プロジェクト: blester125/mPRdicon
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
ファイル: participants.py プロジェクト: ZEDGR/pychallonge
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
ファイル: participants.py プロジェクト: ZEDGR/pychallonge
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
ファイル: matches.py プロジェクト: maxwasserman/pychallonge
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
ファイル: tournaments.py プロジェクト: AJAnderson/pychallonge
def update(tournament, **params):
    """Update a tournament's attributes."""
    api.fetch("PUT", "tournaments/%s" % tournament, "tournament", **params)
コード例 #28
0
ファイル: participants.py プロジェクト: kingkiat/pychallonge
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))