Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (33 sloc) 1.13 KB
import pkg_resources
from pylons import config
from anygit.backends import common
# Top level names to import
__BACKEND_VARS = ['create_schema',
'setup',
'destroy_session']
__COMMON_VARS = ['flush',
'GitObject',
'Blob',
'Tree',
'Tag',
'Commit',
'Repository',
'BlobTree',
'BlobTag',
'TreeParentTree',
'TreeCommit',
'TreeTag',
'CommitParentCommit',
'CommitTree',
'CommitTag',
'TagParentTag',
'Aggregate']
# Get the first (and only) entry point, and extract the given
# names into our namespace.
__BACKEND_NAME = config.get('backend', 'mongodb')
__BACKEND_EP = pkg_resources.iter_entry_points('anygit.backend', __BACKEND_NAME).next()
__BACKEND = __BACKEND_EP.load()
for module, variables in [(common, __COMMON_VARS), (__BACKEND, __BACKEND_VARS)]:
for variable in variables:
globals()[variable] = getattr(module, variable)
del module, variable, variables