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

All Samples(100)  |  Call(66)  |  Derive(0)  |  Import(34)
Return absolute path by working out path relative to games root

        def get_absolute_path(directory):
    """
    Return absolute path by working out path relative to games root
    """
    if isabs(directory):
        return directory

    return realpath(normpath(join(config['games_root'], directory)))
        


src/t/u/turbulenz_local-1.1.4/turbulenz_local/models/apiv1/badges.py   turbulenz_local(Download)
# pylint: enable=F0401
 
from turbulenz_local.tools import get_absolute_path, create_dir
 
REQUIRED_BADGE_KEYS = ['key', 'title', 'description', 'points', 'shape']
        self.userbadges_path = None
 
        self.abs_game_path = get_absolute_path(game.path)
 
        try:
            self.lock.acquire()
            yaml_path = norm_path(get_absolute_path(join_path(game.path, 'badges.yaml')))
            if not create_dir(path):
                LOG.error('Game badges path \"%s\" could not be created.', path)
            self.userbadges_path = norm_path(join_path(get_absolute_path(path), self.game.slug) + '.yaml')
 
    def upsert_badge(self, ub):

src/t/u/turbulenz_local-HEAD/turbulenz_local/models/apiv1/badges.py   turbulenz_local(Download)
# pylint: enable=F0401
 
from turbulenz_local.tools import get_absolute_path, create_dir
 
REQUIRED_BADGE_KEYS = ['key', 'title', 'description', 'points', 'shape']
        self.userbadges_path = None
 
        self.abs_game_path = get_absolute_path(game.path)
 
        try:
            self.lock.acquire()
            yaml_path = norm_path(get_absolute_path(join_path(game.path, 'badges.yaml')))
            if not create_dir(path):
                LOG.error('Game badges path \"%s\" could not be created.', path)
            self.userbadges_path = norm_path(join_path(get_absolute_path(path), self.game.slug) + '.yaml')
 
    def upsert_badge(self, ub):

src/t/u/turbulenz_local-1.1.4/turbulenz_local/models/game.py   turbulenz_local(Download)
from turbulenz_local.models.apiv1.store import StoreList, StoreError, \
                                                   StoreUnsupported
from turbulenz_local.tools import get_absolute_path, create_dir, load_json_asset
 
 
    """
    try:
        game_path = get_absolute_path(game_path)
        game_path = join_path(game_path, manifest_name)
        f = open(unicode(game_path), 'r')
        raise GamePathError('No path found in game data.\nData=' +\
                            '\n'.join(['%s:\t%s' % (k, v) for k, v in data.iteritems()]))
    path = get_absolute_path(path)
 
    # write the YAML data
    def iterate_dir(cls, path, files, directories):
        abs_static_path = get_absolute_path(path)
 
        for file_name in listdir(abs_static_path):
            if os.path.isdir(os.path.join(abs_static_path, file_name)) != True:
    def get_asset_list(self, request_path, path=''):
        if self.path.is_correct():
            game_path = self.path
            abs_game_path = get_absolute_path(game_path)
 

src/t/u/turbulenz_local-HEAD/turbulenz_local/models/game.py   turbulenz_local(Download)
from turbulenz_local.models.apiv1.store import StoreList, StoreError, \
                                                   StoreUnsupported
from turbulenz_local.tools import get_absolute_path, create_dir, load_json_asset
 
 
    """
    try:
        game_path = get_absolute_path(game_path)
        game_path = join_path(game_path, manifest_name)
        f = open(unicode(game_path), 'r')
        raise GamePathError('No path found in game data.\nData=' +\
                            '\n'.join(['%s:\t%s' % (k, v) for k, v in data.iteritems()]))
    path = get_absolute_path(path)
 
    # write the YAML data
    def iterate_dir(cls, path, files, directories):
        abs_static_path = get_absolute_path(path)
 
        for file_name in listdir(abs_static_path):
            if os.path.isdir(os.path.join(abs_static_path, file_name)) != True:
    def get_asset_list(self, request_path, path=''):
        if self.path.is_correct():
            game_path = self.path
            abs_game_path = get_absolute_path(game_path)
 

src/t/u/turbulenz_local-1.1.4/turbulenz_local/models/apiv1/gameprofile.py   turbulenz_local(Download)
 
from turbulenz_local.models.userlist import get_user
from turbulenz_local.tools import get_absolute_path, create_dir
 
LOG = getLogger(__name__)
            LOG.error(error_msg)
            raise GameProfileError(error_msg)
        self.path = get_absolute_path(path)
 
        self.defaults = {}
        default_yaml_path = unicode(get_absolute_path(join_path(game.path, 'defaultgameprofiles.yaml')))

src/t/u/turbulenz_local-HEAD/turbulenz_local/models/apiv1/gameprofile.py   turbulenz_local(Download)
 
from turbulenz_local.models.userlist import get_user
from turbulenz_local.tools import get_absolute_path, create_dir
 
LOG = getLogger(__name__)
            LOG.error(error_msg)
            raise GameProfileError(error_msg)
        self.path = get_absolute_path(path)
 
        self.defaults = {}
        default_yaml_path = unicode(get_absolute_path(join_path(game.path, 'defaultgameprofiles.yaml')))

src/t/u/turbulenz_local-1.1.4/turbulenz_local/models/apiv1/gamenotifications.py   turbulenz_local(Download)
# pylint: enable=F0401
 
from turbulenz_local.tools import get_absolute_path, create_dir
 
# pylint: disable=C0103
    def __init__(self, game):
 
        self.game = game
 
        self.abs_game_path = get_absolute_path(game.path)
 
        try:
            yaml_path = norm_path(get_absolute_path(join_path(game.path, 'gamenotifications.yaml')))
 
    if filename:
        return get_absolute_path(join_path(path, filename))
    else:
        return path

src/t/u/turbulenz_local-1.1.4/turbulenz_local/models/gamedetails.py   turbulenz_local(Download)
from re import compile as re_compile
 
from turbulenz_local.tools import slugify, get_absolute_path
from turbulenz_local import SDK_VERSION
 
    def is_correct(self):
        try:
            abs_path = get_absolute_path(self.__str__())
            return access(abs_path, W_OK)
        except (AttributeError, TypeError):
    def is_correct(self):
        try:
            path = get_absolute_path(self.game.path)
            path = join_path(path, self.image_path)
        except (AttributeError, TypeError):

src/t/u/turbulenz_local-HEAD/turbulenz_local/models/apiv1/gamenotifications.py   turbulenz_local(Download)
# pylint: enable=F0401
 
from turbulenz_local.tools import get_absolute_path, create_dir
 
# pylint: disable=C0103
    def __init__(self, game):
 
        self.game = game
 
        self.abs_game_path = get_absolute_path(game.path)
 
        try:
            yaml_path = norm_path(get_absolute_path(join_path(game.path, 'gamenotifications.yaml')))
 
    if filename:
        return get_absolute_path(join_path(path, filename))
    else:
        return path

src/t/u/turbulenz_local-1.1.4/turbulenz_local/models/apiv1/store.py   turbulenz_local(Download)
# pylint: enable=F0401
 
from turbulenz_local.tools import get_absolute_path, create_dir
from turbulenz_local.lib.validation import ValidationException
from turbulenz_local.lib.tools import create_id
        if not create_dir(path):
            raise StoreError('User store items path \"%s\" could not be created.' % path)
        self.path = get_absolute_path(path)
        self.lock = Lock()
        self._read()
            return num_errors
 
        yaml_path = unicode(get_absolute_path(join_path(game.path, 'storeitems.yaml')))
        if path_exists(yaml_path):
            try:

  1 | 2 | 3 | 4  Next