Source

fat-po-editor / fat / fat_po_editor / bl / repository.py

# -*- coding: utf-8 -*-

from django.utils.translation import ugettext as _

from fat_po_editor.models_mongo import Repository

def get_all():
    return []

class UserAlertError(Exception): pass

def add(path):
    import os
    
    if not path:
        raise UserAlertError(_(u'Repository path can not be empty.'))
    if not os.path.exists(path):
        raise UserAlertError(_(u'Path %(path)s does not exist.') % dict(
                path=path))
    # repostiory = Repository(path=path)
    # repository.save()