comparison sat_frontends/jp/common.py @ 3626:82e616b70a2a

CLI: fix section used for config following name change
author Goffi <goffi@goffi.org>
date Fri, 27 Aug 2021 14:46:52 +0200
parents 04283582966f
children 9ca19b317293 fc24e611c9aa
comparison
equal deleted inserted replaced
3614:422049bb81d3 3626:82e616b70a2a
197 content_file_obj.seek(0) 197 content_file_obj.seek(0)
198 tmp_ori_hash = hashlib.sha1(content_file_obj.read()).digest() 198 tmp_ori_hash = hashlib.sha1(content_file_obj.read()).digest()
199 content_file_obj.close() 199 content_file_obj.close()
200 200
201 # we prepare arguments 201 # we prepare arguments
202 editor = config.getConfig(self.sat_conf, "jp", "editor") or os.getenv( 202 editor = config.getConfig(self.sat_conf, C.CONFIG_SECTION, "editor") or os.getenv(
203 "EDITOR", "vi" 203 "EDITOR", "vi"
204 ) 204 )
205 try: 205 try:
206 # is there custom arguments in sat.conf ? 206 # is there custom arguments in sat.conf ?
207 editor_args = config.getConfig( 207 editor_args = config.getConfig(
208 self.sat_conf, "jp", editor_args_opt, Exception 208 self.sat_conf, C.CONFIG_SECTION, editor_args_opt, Exception
209 ) 209 )
210 except (NoOptionError, NoSectionError): 210 except (NoOptionError, NoSectionError):
211 # no, we check if we know the editor and have special arguments 211 # no, we check if we know the editor and have special arguments
212 if self.use_metadata: 212 if self.use_metadata:
213 editor_args = EDITOR_ARGS_MAGIC.get(os.path.basename(editor), "") 213 editor_args = EDITOR_ARGS_MAGIC.get(os.path.basename(editor), "")