mirror of
https://gitlab.com/datalifeit/trytond-edw_mssql
synced 2023-12-14 05:52:58 +01:00
Fix doctest
This commit is contained in:
parent
50c58aa951
commit
f2d6ac5289
2 changed files with 0 additions and 28 deletions
|
@ -10,7 +10,6 @@ pipeline:
|
|||
- TOX_TESTENV_PASSENV=CFLAGS
|
||||
- POSTGRESQL_URI=postgresql://postgres@postgresql:5432/
|
||||
commands:
|
||||
- python tests/netrc2hgrc.py
|
||||
- pip install tox
|
||||
- tox -e "${TOXENV}-${DATABASE}"
|
||||
volumes:
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
import netrc
|
||||
import os
|
||||
try:
|
||||
from configparser import ConfigParser, DuplicateSectionError
|
||||
except ImportError:
|
||||
from ConfigParser import ConfigParser, DuplicateSectionError
|
||||
|
||||
|
||||
def main():
|
||||
netrc_ = netrc.netrc(os.path.expanduser('~/.netrc'))
|
||||
config = ConfigParser()
|
||||
try:
|
||||
config.add_section('auth')
|
||||
except DuplicateSectionError:
|
||||
pass
|
||||
hgrc = os.path.expanduser('~/.hgrc')
|
||||
config.read(hgrc)
|
||||
for host, (login, _, password) in netrc_.hosts.items():
|
||||
config.set('auth', host + '.prefix', host)
|
||||
config.set('auth', host + '.username', login)
|
||||
config.set('auth', host + '.password', password)
|
||||
with open(hgrc, 'w') as fp:
|
||||
config.write(fp)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in a new issue