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

All Samples(14)  |  Call(8)  |  Derive(0)  |  Import(6)
Generates an ASCII-only slug. Could be a lot better.

        def slugify(text, delim=u'-'):
    """Generates an ASCII-only slug. Could be a lot better."""
    result = []
    for word in _PUNCT_RE.split(unicode(text).lower()):
        word = normalize('NFKD', word).encode('ascii', 'ignore')
        if word:
            result.append(word)
    return unicode(delim.join(result))
        


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 __new__(cls, value=None):
        if not value:
            value = 'new-game'
        else:
            value = slugify(value)
    def is_correct(self):
        return slugify(self.__str__()) == self.__str__()
# pylint: enable=R0904
 
 

src/t/u/turbulenz_local-HEAD/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 __new__(cls, value=None):
        if not value:
            value = 'new-game'
        else:
            value = slugify(value)
    def is_correct(self):
        return slugify(self.__str__()) == self.__str__()
# pylint: enable=R0904
 
 

src/t/u/turbulenz_local-1.1.4/turbulenz_local/controllers/localv1/edit.py   turbulenz_local(Download)
 
from turbulenz_local.decorators import jsonify
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
            return {'ok': False, 'msg': 'Title not specified'}
 
        base_slug = slugify(title)
        unique_slug = GameList.get_instance().make_slug_unique(base_slug)
        if base_slug == unique_slug:

src/t/u/turbulenz_local-HEAD/turbulenz_local/controllers/localv1/edit.py   turbulenz_local(Download)
 
from turbulenz_local.decorators import jsonify
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
            return {'ok': False, 'msg': 'Title not specified'}
 
        base_slug = slugify(title)
        unique_slug = GameList.get_instance().make_slug_unique(base_slug)
        if base_slug == unique_slug:

src/t/u/turbulenz_local-1.1.4/turbulenz_local/helpers.py   turbulenz_local(Download)
from turbulenz_local import SDK_VERSION, CONFIG_PATH
from turbulenz_local.models.gamelist import get_game_by_slug
from turbulenz_local.tools import slugify as slugify_fn
 
LOG = logging.getLogger(__name__)
    def slugify(cls, s):
        return slugify_fn(s)
 
#######################################################################################################################
 

src/t/u/turbulenz_local-HEAD/turbulenz_local/helpers.py   turbulenz_local(Download)
from turbulenz_local import SDK_VERSION, CONFIG_PATH
from turbulenz_local.models.gamelist import get_game_by_slug
from turbulenz_local.tools import slugify as slugify_fn
 
LOG = logging.getLogger(__name__)
    def slugify(cls, s):
        return slugify_fn(s)
 
#######################################################################################################################