3 from ConfigParser
import NoSectionError
, NoOptionError
9 if e
.errno
== errno
.EEXIST
:
14 def getRepositoryDir(config
):
15 repositories
= os
.path
.expanduser('~')
17 path
= config
.get('gitosis', 'repositories')
18 except (NoSectionError
, NoOptionError
):
19 repositories
= os
.path
.join(repositories
, 'repositories')
21 repositories
= os
.path
.join(repositories
, path
)
24 def getGeneratedFilesDir(config
):
26 generated
= config
.get('gitosis', 'generate-files-in')
27 except (NoSectionError
, NoOptionError
):
28 generated
= os
.path
.expanduser('~/gitosis')
31 def getSSHAuthorizedKeysPath(config
):
33 path
= config
.get('gitosis', 'ssh-authorized-keys-path')
34 except (NoSectionError
, NoOptionError
):
35 path
= os
.path
.expanduser('~/.ssh/authorized_keys')