<s> import pkg_resources <EOL> from tiget . conf import settings <EOL> class GitError ( Exception ) : pass <EOL> def get_config ( name ) : <EOL> repo = settings . core . repository <EOL> if repo is None : <EOL> raise GitError ( '<STR_LIT>' ) <EOL> return repo . config [ name ] <EOL> def is_repo_initialized ( ) : <EOL> repo = settings . core . repository <EOL> if repo is None : <EOL> return False <EOL> ref = '<STR_LIT>' . format ( settings . core . branch ) <EOL> try : <EOL> repo . lookup_reference ( ref ) <EOL> except KeyError : <EOL> return False <EOL> return True <EOL> def init_repo ( ) : <EOL> from git_orm import transaction <EOL> if is_repo_initialized ( ) : <EOL> raise GitError ( '<STR_LIT>' ) <EOL> with transaction . wrap ( ) as trans : <EOL> tigetrc = pkg_resources . resource_string ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> trans . set_blob ( [ '<STR_LIT>' , '<STR_LIT>' ] , tigetrc ) <EOL> trans . add_message ( '<STR_LIT>' ) </s>
