Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(128)  |  Call(88)  |  Derive(0)  |  Import(40)

        def get_game_by_slug(slug, reload_game=False):
    return GameList.get_instance().get_by_slug(slug, reload_game)
        


src/t/u/turbulenz_local-1.1.4/turbulenz_local/controllers/localv1/edit.py   turbulenz_local(Download)
from turbulenz_local.tools import get_absolute_path, slugify
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.gamelist import GameList, get_game_by_slug
from turbulenz_local.models.game import GamePathNotFoundError, GamePathError, GameNotFoundError, GameError
 
    def overview(cls, slug):
        """
        Show "Manage Game" form.
        """
        game = get_game_by_slug(slug, reload_game=True)
        parameters.
        """
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
        to a game.
        """
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404

src/t/u/turbulenz_local-HEAD/turbulenz_local/controllers/localv1/edit.py   turbulenz_local(Download)
from turbulenz_local.tools import get_absolute_path, slugify
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.gamelist import GameList, get_game_by_slug
from turbulenz_local.models.game import GamePathNotFoundError, GamePathError, GameNotFoundError, GameError
 
    def overview(cls, slug):
        """
        Show "Manage Game" form.
        """
        game = get_game_by_slug(slug, reload_game=True)
        parameters.
        """
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
        to a game.
        """
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404

src/t/u/turbulenz_local-1.1.4/turbulenz_local/controllers/apiv1/datashare.py   turbulenz_local(Download)
from turbulenz_local.models.userlist import get_current_user
 
from turbulenz_local.models.gamelist import get_game_by_slug
 
from turbulenz_local.lib.exceptions import BadRequest, NotFound
    def remove_all(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            raise NotFound('No game with slug %s' % slug)
        DataShareList.get(game).remove_all()
    def create(cls, slug):
        game = get_game_by_slug(slug)
        datashare = DataShareList.get(game).create_datashare(get_current_user())
        return {'ok': True, 'data': {'datashare': datashare.summary_dict()}}
 
    def join(cls, slug, datashare_id):
        game = get_game_by_slug(slug)
        datashare = DataShareList.get(game).get(datashare_id)
        datashare.join(get_current_user())
        return {'ok': True, 'data': {'users': datashare.users}}
    def leave(cls, slug, datashare_id):
        game = get_game_by_slug(slug)
        DataShareList.get(game).leave_datashare(get_current_user(), datashare_id)
        return {'ok': True}
 

src/t/u/turbulenz_local-HEAD/turbulenz_local/controllers/apiv1/datashare.py   turbulenz_local(Download)
from turbulenz_local.models.userlist import get_current_user
 
from turbulenz_local.models.gamelist import get_game_by_slug
 
from turbulenz_local.lib.exceptions import BadRequest, NotFound
    def remove_all(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            raise NotFound('No game with slug %s' % slug)
        DataShareList.get(game).remove_all()
    def create(cls, slug):
        game = get_game_by_slug(slug)
        datashare = DataShareList.get(game).create_datashare(get_current_user())
        return {'ok': True, 'data': {'datashare': datashare.summary_dict()}}
 
    def join(cls, slug, datashare_id):
        game = get_game_by_slug(slug)
        datashare = DataShareList.get(game).get(datashare_id)
        datashare.join(get_current_user())
        return {'ok': True, 'data': {'users': datashare.users}}
    def leave(cls, slug, datashare_id):
        game = get_game_by_slug(slug)
        DataShareList.get(game).leave_datashare(get_current_user(), datashare_id)
        return {'ok': True}
 

src/t/u/turbulenz_local-1.1.4/turbulenz_local/controllers/localv1/list.py   turbulenz_local(Download)
from turbulenz_local.decorators import jsonify
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.gamelist import get_game_by_slug
from turbulenz_local.models.game import GamePathError, GamePathNotFoundError
 
    def overview(cls, slug):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}
    def assets(cls, slug, path=''):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}
    def files(cls, slug, path=''):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}

src/t/u/turbulenz_local-HEAD/turbulenz_local/controllers/localv1/list.py   turbulenz_local(Download)
from turbulenz_local.decorators import jsonify
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.gamelist import get_game_by_slug
from turbulenz_local.models.game import GamePathError, GamePathNotFoundError
 
    def overview(cls, slug):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}
    def assets(cls, slug, path=''):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}
    def files(cls, slug, path=''):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}

src/t/u/turbulenz_local-1.1.4/turbulenz_local/controllers/apiv1/leaderboards.py   turbulenz_local(Download)
from turbulenz_local.controllers import BaseController
 
from turbulenz_local.models.gamelist import get_game_by_slug
from turbulenz_local.models.apiv1.leaderboards import LeaderboardsList, LeaderboardError
from turbulenz_local.models.userlist import get_current_user
    def read_meta(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}
    def read_overview(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}
    def read_aggregates(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}
    def read_expanded(cls, slug, key):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}

src/t/u/turbulenz_local-HEAD/turbulenz_local/controllers/apiv1/leaderboards.py   turbulenz_local(Download)
from turbulenz_local.controllers import BaseController
 
from turbulenz_local.models.gamelist import get_game_by_slug
from turbulenz_local.models.apiv1.leaderboards import LeaderboardsList, LeaderboardError
from turbulenz_local.models.userlist import get_current_user
    def read_meta(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}
    def read_overview(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}
    def read_aggregates(cls, slug):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}
    def read_expanded(cls, slug, key):
        game = get_game_by_slug(slug)
        if game is None:
            response.status_int = 404
            return {'ok': False, 'msg': 'No game with that slug'}

src/t/u/turbulenz_local-1.1.4/turbulenz_local/controllers/localv1/deploy.py   turbulenz_local(Download)
from turbulenz_local.decorators import jsonify
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.gamelist import get_game_by_slug, GameError
from turbulenz_local.lib.deploy import Deployment
 
            return {'ok': False, 'msg': 'Wrong project information.'}
 
        game = get_game_by_slug(game)
        if not game or not game.path.is_set() or not game.path.is_correct():
            response.status_int = 400
                return {'ok': False, 'msg': 'Wrong request.'}
 
            game = get_game_by_slug(game)
            if game:
                game.set_deployed()
    def check(cls, slug):
 
        # get game
        game = get_game_by_slug(slug)
 

src/t/u/turbulenz_local-1.1.4/turbulenz_local/controllers/localv1/userdata.py   turbulenz_local(Download)
from turbulenz_local.models.game import _File
from turbulenz_local.models.apiv1.userdata import UserData
from turbulenz_local.models.gamelist import get_game_by_slug
 
LOG = logging.getLogger(__name__)
    def overview(cls, slug):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}
    def userkeys(cls, slug, username):
        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Game does not exist: %s' % slug}

  1 | 2 | 3 | 4  Next