##// END OF EJS Templates
compat: use py3 compatible configparser in all places.
marcink -
r2355:1176c026 default
parent child Browse files
Show More
@@ -22,7 +22,7 b' import os'
22 import re
22 import re
23 import logging
23 import logging
24 import datetime
24 import datetime
25 import ConfigParser
25 from pyramid.compat import configparser
26
26
27 from rhodecode.model.db import Session, User, UserSshKeys
27 from rhodecode.model.db import Session, User, UserSshKeys
28 from rhodecode.model.scm import ScmModel
28 from rhodecode.model.scm import ScmModel
@@ -51,7 +51,7 b' class SshWrapper(object):'
51 self.server_impl = None
51 self.server_impl = None
52
52
53 def parse_config(self, config_path):
53 def parse_config(self, config_path):
54 parser = ConfigParser.ConfigParser()
54 parser = configparser.ConfigParser()
55 parser.read(config_path)
55 parser.read(config_path)
56 return parser
56 return parser
57
57
@@ -20,7 +20,7 b''
20
20
21 import os
21 import os
22 import pytest
22 import pytest
23 import ConfigParser
23 from pyramid.compat import configparser
24
24
25 from rhodecode.apps.ssh_support.lib.ssh_wrapper import SshWrapper
25 from rhodecode.apps.ssh_support.lib.ssh_wrapper import SshWrapper
26 from rhodecode.lib.utils2 import AttributeDict
26 from rhodecode.lib.utils2 import AttributeDict
@@ -28,7 +28,7 b' from rhodecode.lib.utils2 import Attribu'
28
28
29 @pytest.fixture
29 @pytest.fixture
30 def dummy_conf_file(tmpdir):
30 def dummy_conf_file(tmpdir):
31 conf = ConfigParser.ConfigParser()
31 conf = configparser.ConfigParser()
32 conf.add_section('app:main')
32 conf.add_section('app:main')
33 conf.set('app:main', 'ssh.executable.hg', '/usr/bin/hg')
33 conf.set('app:main', 'ssh.executable.hg', '/usr/bin/hg')
34 conf.set('app:main', 'ssh.executable.git', '/usr/bin/git')
34 conf.set('app:main', 'ssh.executable.git', '/usr/bin/git')
@@ -19,13 +19,13 b''
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20
21 import os
21 import os
22 import ConfigParser
22 from pyramid.compat import configparser
23 from pyramid.paster import bootstrap as pyramid_bootstrap
23 from pyramid.paster import bootstrap as pyramid_bootstrap, setup_logging # noqa
24 from pyramid.request import Request
24 from pyramid.request import Request
25
25
26
26
27 def get_config(ini_path, **kwargs):
27 def get_config(ini_path, **kwargs):
28 parser = ConfigParser.ConfigParser(**kwargs)
28 parser = configparser.ConfigParser(**kwargs)
29 parser.read(ini_path)
29 parser.read(ini_path)
30 return parser
30 return parser
31
31
@@ -41,7 +41,7 b' def bootstrap(config_uri, request=None, '
41 base_url = 'http://rhodecode.local'
41 base_url = 'http://rhodecode.local'
42 try:
42 try:
43 base_url = config.get('app:main', 'app.base_url')
43 base_url = config.get('app:main', 'app.base_url')
44 except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
44 except (configparser.NoSectionError, configparser.NoOptionError):
45 pass
45 pass
46
46
47 request = request or Request.blank('/', base_url=base_url)
47 request = request or Request.blank('/', base_url=base_url)
@@ -25,8 +25,8 b' import time'
25 import platform
25 import platform
26 import pkg_resources
26 import pkg_resources
27 import logging
27 import logging
28 import string
29
28
29 from pyramid.compat import configparser
30
30
31 log = logging.getLogger(__name__)
31 log = logging.getLogger(__name__)
32
32
@@ -555,7 +555,6 b' def rhodecode_app_info():'
555
555
556 def rhodecode_config():
556 def rhodecode_config():
557 import rhodecode
557 import rhodecode
558 import ConfigParser as configparser
559 path = rhodecode.CONFIG.get('__file__')
558 path = rhodecode.CONFIG.get('__file__')
560 rhodecode_ini_safe = rhodecode.CONFIG.copy()
559 rhodecode_ini_safe = rhodecode.CONFIG.copy()
561
560
@@ -24,11 +24,11 b' GIT commit module'
24
24
25 import re
25 import re
26 import stat
26 import stat
27 from ConfigParser import ConfigParser
28 from itertools import chain
27 from itertools import chain
29 from StringIO import StringIO
28 from StringIO import StringIO
30
29
31 from zope.cachedescriptors.property import Lazy as LazyProperty
30 from zope.cachedescriptors.property import Lazy as LazyProperty
31 from pyramid.compat import configparser
32
32
33 from rhodecode.lib.datelib import utcdate_fromtimestamp
33 from rhodecode.lib.datelib import utcdate_fromtimestamp
34 from rhodecode.lib.utils import safe_unicode, safe_str
34 from rhodecode.lib.utils import safe_unicode, safe_str
@@ -533,7 +533,7 b' class GitCommit(base.BaseCommit):'
533 # ConfigParser fails if there are whitespaces
533 # ConfigParser fails if there are whitespaces
534 content = '\n'.join(l.strip() for l in content.split('\n'))
534 content = '\n'.join(l.strip() for l in content.split('\n'))
535
535
536 parser = ConfigParser()
536 parser = configparser.ConfigParser()
537 parser.readfp(StringIO(content))
537 parser.readfp(StringIO(content))
538
538
539 for section in parser.sections():
539 for section in parser.sections():
General Comments 0
You need to be logged in to leave comments. Login now