(self, arg_strings)
| 1995 | return namespace, extras |
| 1996 | |
| 1997 | def _read_args_from_files(self, arg_strings): |
| 1998 | # expand arguments referencing files |
| 1999 | new_arg_strings = [] |
| 2000 | for arg_string in arg_strings: |
| 2001 | |
| 2002 | # for regular arguments, just add them back into the list |
| 2003 | if not arg_string or arg_string[0] not in self.fromfile_prefix_chars: |
| 2004 | new_arg_strings.append(arg_string) |
| 2005 | |
| 2006 | # replace arguments referencing files with the file content |
| 2007 | else: |
| 2008 | try: |
| 2009 | args_file = open(arg_string[1:]) |
| 2010 | try: |
| 2011 | arg_strings = [] |
| 2012 | for arg_line in args_file.read().splitlines(): |
| 2013 | for arg in self.convert_arg_line_to_args(arg_line): |
| 2014 | arg_strings.append(arg) |
| 2015 | arg_strings = self._read_args_from_files(arg_strings) |
| 2016 | new_arg_strings.extend(arg_strings) |
| 2017 | finally: |
| 2018 | args_file.close() |
| 2019 | except IOError: |
| 2020 | err = _sys.exc_info()[1] |
| 2021 | self.error(str(err)) |
| 2022 | |
| 2023 | # return the modified argument list |
| 2024 | return new_arg_strings |
| 2025 | |
| 2026 | def convert_arg_line_to_args(self, arg_line): |
| 2027 | return [arg_line] |
no test coverage detected