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

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)

src/k/n/kninfra-HEAD/kn/utils/daan/fotoadmin.py   kninfra(Download)
        return {'error': 'Invalid name'}
    event = date + '-' + name
    path = os.path.join(settings.PHOTOS_DIR, event)
    if os.path.isdir(path):
        return {'error': 'Event already exists'}
    if not os.path.realpath(fotos_path).startswith(user_path):
        return {'error': 'Security exception'}
    target_path = os.path.join(settings.PHOTOS_DIR, event)
    if not os.path.isdir(target_path):
        return {'error': 'Event does not exist'}

src/k/n/kninfra-HEAD/kn/fotos/forms.py   kninfra(Download)
from django import forms
 
from kn.settings import PHOTOS_DIR, USER_DIRS
 
def move_fotos_scan_userdirs():
def move_fotos_list_events():
    events = list(map(os.path.basename, glob('%s/20*' % PHOTOS_DIR)))
    events.sort(reverse=True)
    return map(lambda x: (x, x), events)
 

src/k/n/kninfra-HEAD/kn/fotos/views.py   kninfra(Download)
 
from kn.fotos.forms import CreateEventForm, getMoveFotosForm
from kn.settings import PHOTOS_DIR, PHOTOS_MYSQL_SECRET
from kn.leden import giedo
 
    else:
        form = CreateEventForm()
    events = list(map(basename, glob('%s/20*' % PHOTOS_DIR)))
    events.sort(reverse=True)
    return render_to_response('fotos/admin/create.html',