diff options
Diffstat (limited to 'hooks.py')
| -rw-r--r-- | hooks.py | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -180,7 +180,7 @@ class RepoHook: | |||
| 180 | abort_if_user_denies was passed to the consturctor. | 180 | abort_if_user_denies was passed to the consturctor. |
| 181 | """ | 181 | """ |
| 182 | hooks_config = self._hooks_project.config | 182 | hooks_config = self._hooks_project.config |
| 183 | git_approval_key = "repo.hooks.%s.%s" % (self._hook_type, subkey) | 183 | git_approval_key = f"repo.hooks.{self._hook_type}.{subkey}" |
| 184 | 184 | ||
| 185 | # Get the last value that the user approved for this hook; may be None. | 185 | # Get the last value that the user approved for this hook; may be None. |
| 186 | old_val = hooks_config.GetString(git_approval_key) | 186 | old_val = hooks_config.GetString(git_approval_key) |
| @@ -193,7 +193,7 @@ class RepoHook: | |||
| 193 | else: | 193 | else: |
| 194 | # Give the user a reason why we're prompting, since they last | 194 | # Give the user a reason why we're prompting, since they last |
| 195 | # told us to "never ask again". | 195 | # told us to "never ask again". |
| 196 | prompt = "WARNING: %s\n\n" % (changed_prompt,) | 196 | prompt = f"WARNING: {changed_prompt}\n\n" |
| 197 | else: | 197 | else: |
| 198 | prompt = "" | 198 | prompt = "" |
| 199 | 199 | ||
| @@ -241,9 +241,8 @@ class RepoHook: | |||
| 241 | return self._CheckForHookApprovalHelper( | 241 | return self._CheckForHookApprovalHelper( |
| 242 | "approvedmanifest", | 242 | "approvedmanifest", |
| 243 | self._manifest_url, | 243 | self._manifest_url, |
| 244 | "Run hook scripts from %s" % (self._manifest_url,), | 244 | f"Run hook scripts from {self._manifest_url}", |
| 245 | "Manifest URL has changed since %s was allowed." | 245 | f"Manifest URL has changed since {self._hook_type} was allowed.", |
| 246 | % (self._hook_type,), | ||
| 247 | ) | 246 | ) |
| 248 | 247 | ||
| 249 | def _CheckForHookApprovalHash(self): | 248 | def _CheckForHookApprovalHash(self): |
| @@ -262,7 +261,7 @@ class RepoHook: | |||
| 262 | "approvedhash", | 261 | "approvedhash", |
| 263 | self._GetHash(), | 262 | self._GetHash(), |
| 264 | prompt % (self._GetMustVerb(), self._script_fullpath), | 263 | prompt % (self._GetMustVerb(), self._script_fullpath), |
| 265 | "Scripts have changed since %s was allowed." % (self._hook_type,), | 264 | f"Scripts have changed since {self._hook_type} was allowed.", |
| 266 | ) | 265 | ) |
| 267 | 266 | ||
| 268 | @staticmethod | 267 | @staticmethod |
