modify import
This commit is contained in:
parent
0224af82ae
commit
54be03a22d
10
update.py
10
update.py
@ -4,7 +4,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import datetime
|
import datetime
|
||||||
import ast
|
import ast
|
||||||
from collections import OrderedDict, namedtuple, defaultdict
|
import collections
|
||||||
|
|
||||||
# we do not use the nicer sys.version_info.major
|
# we do not use the nicer sys.version_info.major
|
||||||
# for compatibility with Python < 2.7
|
# for compatibility with Python < 2.7
|
||||||
@ -277,7 +277,7 @@ def fetch_modules(config, relative_path):
|
|||||||
n = len(l)
|
n = len(l)
|
||||||
|
|
||||||
modules = []
|
modules = []
|
||||||
Module = namedtuple('Module', 'path name')
|
Module = collections.namedtuple('Module', 'path name')
|
||||||
|
|
||||||
warnings = []
|
warnings = []
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ def main(argv):
|
|||||||
|
|
||||||
# read config file
|
# read config file
|
||||||
print('- parsing autocmake.cfg')
|
print('- parsing autocmake.cfg')
|
||||||
config = ConfigParser(dict_type=OrderedDict)
|
config = ConfigParser(dict_type=collections.OrderedDict)
|
||||||
config.read('autocmake.cfg')
|
config.read('autocmake.cfg')
|
||||||
|
|
||||||
if not config.has_option('project', 'name'):
|
if not config.has_option('project', 'name'):
|
||||||
@ -463,7 +463,7 @@ def make_executable(path):
|
|||||||
|
|
||||||
def parse_cmake_module(s_in, defaults={}):
|
def parse_cmake_module(s_in, defaults={}):
|
||||||
|
|
||||||
parsed_config = defaultdict(lambda: None)
|
parsed_config = collections.defaultdict(lambda: None)
|
||||||
|
|
||||||
if 'autocmake.cfg configuration::' not in s_in:
|
if 'autocmake.cfg configuration::' not in s_in:
|
||||||
return parsed_config
|
return parsed_config
|
||||||
@ -489,7 +489,7 @@ def parse_cmake_module(s_in, defaults={}):
|
|||||||
autocmake_entry = '[foo]\n' + autocmake_entry
|
autocmake_entry = '[foo]\n' + autocmake_entry
|
||||||
|
|
||||||
buf = StringIO(autocmake_entry)
|
buf = StringIO(autocmake_entry)
|
||||||
config = ConfigParser(dict_type=OrderedDict)
|
config = ConfigParser(dict_type=collections.OrderedDict)
|
||||||
config.readfp(buf)
|
config.readfp(buf)
|
||||||
|
|
||||||
for section in config.sections():
|
for section in config.sections():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user