Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chainedconfigparser.py

Issue 29756673: Noissue - Adapt best practices for trailing commas (buildtools) (Closed)
Patch Set: Re-run script on Python 2, added flake8-commas extension Created April 19, 2018, 2:09 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build.py ('k') | ensure_dependencies.py » ('j') | tox.ini » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This Source Code Form is subject to the terms of the Mozilla Public 1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this 2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 4
5 import os 5 import os
6 import io 6 import io
7 import ConfigParser 7 import ConfigParser
8 from StringIO import StringIO 8 from StringIO import StringIO
9 9
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 self._process_parsers(self._get_parser_chain(parser, filename)) 137 self._process_parsers(self._get_parser_chain(parser, filename))
138 read_ok.append(filename) 138 read_ok.append(filename)
139 139
140 return read_ok 140 return read_ok
141 141
142 def items(self, section, *args, **kwargs): 142 def items(self, section, *args, **kwargs):
143 items = [] 143 items = []
144 for option, value in ConfigParser.SafeConfigParser.items(self, section, *args, **kwargs): 144 for option, value in ConfigParser.SafeConfigParser.items(self, section, *args, **kwargs):
145 items.append(Item( 145 items.append(Item(
146 option, value, 146 option, value,
147 self._origin[(section, self.optionxform(option))] 147 self._origin[(section, self.optionxform(option))],
148 )) 148 ))
149 return items 149 return items
150 150
151 def option_source(self, section, option): 151 def option_source(self, section, option):
152 option = self.optionxform(option) 152 option = self.optionxform(option)
153 try: 153 try:
154 return self._origin[(section, option)] 154 return self._origin[(section, option)]
155 except KeyError: 155 except KeyError:
156 if not self.has_section(section): 156 if not self.has_section(section):
157 raise ConfigParser.NoSectionError(section) 157 raise ConfigParser.NoSectionError(section)
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 raise NotImplementedError 230 raise NotImplementedError
231 231
232 def add_section(self, section): 232 def add_section(self, section):
233 raise NotImplementedError 233 raise NotImplementedError
234 234
235 def remove_option(self, section, option): 235 def remove_option(self, section, option):
236 raise NotImplementedError 236 raise NotImplementedError
237 237
238 def remove_section(self, section): 238 def remove_section(self, section):
239 raise NotImplementedError 239 raise NotImplementedError
OLDNEW
« no previous file with comments | « build.py ('k') | ensure_dependencies.py » ('j') | tox.ini » ('J')

Powered by Google App Engine
This is Rietveld