scripts: Rename ConfigParser -> configparser for python3
The ConfigParser API was renamed to configparser in python 3. Renamed ConfigParser -> configparser in scripts/ to make the code working in python 3. (From OE-Core rev: de6e98f272e623ce72e724e66920eecf10cb2d41) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
3ee70cb725
commit
fa4275bbc0
|
@ -26,7 +26,7 @@ import optparse
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import ConfigParser
|
import configparser
|
||||||
import re
|
import re
|
||||||
import copy
|
import copy
|
||||||
import pipes
|
import pipes
|
||||||
|
@ -87,7 +87,7 @@ class Configuration(object):
|
||||||
self.commit_msg_template = value
|
self.commit_msg_template = value
|
||||||
|
|
||||||
logger.debug("Loading config file %s" % self.conffile)
|
logger.debug("Loading config file %s" % self.conffile)
|
||||||
self.parser = ConfigParser.ConfigParser()
|
self.parser = configparser.ConfigParser()
|
||||||
with open(self.conffile) as f:
|
with open(self.conffile) as f:
|
||||||
self.parser.readfp(f)
|
self.parser.readfp(f)
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ class Configuration(object):
|
||||||
|
|
||||||
self.localconffile = lcfile
|
self.localconffile = lcfile
|
||||||
logger.debug("Loading local config file %s" % self.localconffile)
|
logger.debug("Loading local config file %s" % self.localconffile)
|
||||||
self.localparser = ConfigParser.ConfigParser()
|
self.localparser = configparser.ConfigParser()
|
||||||
with open(self.localconffile) as f:
|
with open(self.localconffile) as f:
|
||||||
self.localparser.readfp(f)
|
self.localparser.readfp(f)
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ if __name__ == "__main__":
|
||||||
#
|
#
|
||||||
|
|
||||||
m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math",
|
m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math",
|
||||||
"__future__.* _abcoll.* abc.* ast.* copy.* copyreg.* ConfigParser.* " +
|
"__future__.* _abcoll.* abc.* ast.* copy.* copyreg.* configparser.* " +
|
||||||
"genericpath.* getopt.* linecache.* new.* " +
|
"genericpath.* getopt.* linecache.* new.* " +
|
||||||
"os.* posixpath.* struct.* " +
|
"os.* posixpath.* struct.* " +
|
||||||
"warnings.* site.* stat.* " +
|
"warnings.* site.* stat.* " +
|
||||||
|
|
|
@ -22,7 +22,7 @@ import os
|
||||||
import argparse
|
import argparse
|
||||||
import glob
|
import glob
|
||||||
import re
|
import re
|
||||||
import ConfigParser
|
import configparser
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -51,12 +51,12 @@ class ConfigHandler(object):
|
||||||
|
|
||||||
def __init__(self, filename):
|
def __init__(self, filename):
|
||||||
self.config_file = filename
|
self.config_file = filename
|
||||||
self.config_obj = ConfigParser.SafeConfigParser()
|
self.config_obj = configparser.SafeConfigParser()
|
||||||
|
|
||||||
def get(self, section, option, default=None):
|
def get(self, section, option, default=None):
|
||||||
try:
|
try:
|
||||||
ret = self.config_obj.get(section, option)
|
ret = self.config_obj.get(section, option)
|
||||||
except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
|
except (configparser.NoOptionError, configparser.NoSectionError):
|
||||||
if default != None:
|
if default != None:
|
||||||
ret = default
|
ret = default
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue