Lines Matching refs:filename
867 def __init__(self, filename="Kconfig", warn=True, warn_to_stderr=True, argument
947 self._init(filename, warn, warn_to_stderr, encoding)
959 def _init(self, filename, warn, warn_to_stderr, encoding): argument
1054 self.top_node.filename = filename
1061 self.kconfig_filenames = [filename]
1070 self.filename = filename
1080 self._readline = self._open(join(self.srctree, filename), "r").readline
1089 _decoding_error(e, self.filename)
1141 for filename, cond in self.defconfig_list.defaults:
1144 with self._open_config(filename.str_value) as f:
1151 def load_config(self, filename=None, replace=True, verbose=None): argument
1218 if filename is None:
1219 filename = standard_config_filename()
1220 if not exists(filename) and \
1221 not exists(join(self.srctree, filename)):
1225 .format(filename)
1228 .format(defconfig, filename)
1229 filename = defconfig
1232 msg = " configuration '{}'".format(filename)
1241 self._load_config(filename, replace)
1243 _decoding_error(e, filename)
1249 def _load_config(self, filename, replace): argument
1250 with self._open_config(filename) as f:
1280 self._undef_assign(name, val, filename, linenr)
1294 filename, linenr)
1310 filename, linenr)
1321 filename, linenr)
1336 filename, linenr)
1343 self._undef_assign(name, "n", filename, linenr)
1354 self._assigned_twice(sym, val, filename, linenr)
1370 def _undef_assign(self, name, val, filename, linenr): argument
1377 .format(val, name), filename, linenr)
1379 def _assigned_twice(self, sym, new_val, filename, linenr): argument
1393 self._warn(msg, filename, linenr)
1395 self._warn(msg, filename, linenr)
1397 def load_allconfig(self, filename): argument
1417 load_allconfig(self, filename)
1419 def write_autoconf(self, filename=None, header=None): argument
1454 if filename is None:
1455 filename = os.getenv("KCONFIG_AUTOHEADER",
1458 if self._write_if_changed(filename, self._autoconf_contents(header)):
1459 return "Kconfig header saved to '{}'".format(filename)
1460 return "No change to Kconfig header in '{}'".format(filename)
1505 def write_config(self, filename=None, header=None, save_old=True, argument
1569 if filename is None:
1570 filename = standard_config_filename()
1573 if self._contents_eq(filename, contents):
1574 return "No change to configuration in '{}'".format(filename)
1577 _save_old(filename)
1579 with self._open(filename, "w") as f:
1582 return "Configuration saved to '{}'".format(filename)
1659 def write_min_config(self, filename, header=None): argument
1692 if self._write_if_changed(filename, self._min_config_contents(header)):
1693 return "Minimal configuration saved to '{}'".format(filename)
1694 return "No change to minimal configuration in '{}'".format(filename)
1982 self.filename = None
2112 def _open_config(self, filename): argument
2118 return self._open(filename, "r")
2123 return self._open(join(self.srctree, filename), "r")
2134 .format(filename, errno.errorcode[e.errno], e.strerror,
2138 def _enter_file(self, filename): argument
2148 if filename.startswith(self._srctree_prefix):
2151 rel_filename = filename[len(self._srctree_prefix):]
2154 rel_filename = filename
2176 self._include_path += ((self.filename, self.linenr),)
2185 .format(self.filename, self.linenr, rel_filename,
2190 self._readline = self._open(filename, "r").readline
2195 .format(self.filename, self.linenr, filename,
2199 self.filename = rel_filename
2207 self.filename, self.linenr = self._include_path[-1]
2261 def _write_if_changed(self, filename, contents): argument
2274 if self._contents_eq(filename, contents):
2276 with self._open(filename, "w") as f:
2280 def _contents_eq(self, filename, contents): argument
2285 with self._open(filename, "r") as f:
2431 self.filename, self.linenr)
2850 .format(self.filename, self.linenr, fn,
2939 node.filename = self.filename
2976 pattern = join(dirname(self.filename), pattern)
2994 .format(self.filename, self.linenr, pattern,
2999 for filename in filenames:
3000 self._enter_file(filename)
3033 node.filename = self.filename
3053 node.filename = self.filename
3085 node.filename = self.filename
3117 self.filename))
3229 self.filename, self.linenr)
3239 self.filename, self.linenr)
3249 self.filename, self.linenr)
3266 self.filename, self.linenr)
3917 "" if self.filename is None else
3918 "{}:{}: ".format(self.filename, self.linenr),
3924 def _open(self, filename, mode): argument
3958 return open(filename, "rU" if mode == "r" else mode) if _IS_PY2 else \
3959 open(filename, mode, encoding=self._encoding)
4003 .format(node.filename, node.linenr, node)
4006 def _warn(self, msg, filename=None, linenr=None): argument
4013 if filename is not None:
4014 msg = "{}:{}: {}".format(filename, linenr, msg)
4776 add("{}:{}".format(node.filename, node.linenr))
5382 add("{}:{}".format(node.filename, node.linenr))
5800 add("{}:{}".format(self.filename, self.linenr))
6021 ioerror.errno, ioerror.strerror, ioerror.filename)
6280 def load_allconfig(kconf, filename): argument
6297 return IOError(e.errno, e.strerror, e.filename)
6305 print(kconf.load_config(filename, False))
6312 .format(filename, std_msg(e1), std_msg(e2)))
6766 def _decoding_error(e, filename, macro_linenr=None): argument
6781 "'{}'".format(filename) if macro_linenr is None else
6782 "output from macro at {}:{}".format(filename, macro_linenr),
6802 return kconf.filename
6810 print("{}:{}: {}".format(kconf.filename, kconf.linenr, msg))
6817 kconf._warn(msg, kconf.filename, kconf.linenr)
6825 kconf.filename, kconf.linenr, msg))
6842 _decoding_error(e, kconf.filename, kconf.linenr)
6847 kconf.filename, kconf.linenr)