()
| 356 | |
| 357 | |
| 358 | def resolve_gpghome(): |
| 359 | for p in [ |
| 360 | # Linux, macos |
| 361 | os.path.join(os.path.expanduser("~"), '.gnupg'), |
| 362 | # Windows 10 |
| 363 | os.path.expandvars(r'%APPDATA%\GnuPG') |
| 364 | # TODO: Should we support Cygwin? |
| 365 | ]: |
| 366 | if os.path.exists(os.path.join(p, 'secring.gpg')): |
| 367 | return p |
| 368 | return None |
| 369 | |
| 370 | |
| 371 | def main(): |