-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
80 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
import getpass | ||
import garth | ||
|
||
domain = input("Garmin domain [garmin.com]: ") or 'garmin.com' | ||
username = input("Username (e-mail): ") | ||
if not sys.stdin.isatty(): # This terminal cannot support input without displaying text | ||
print(f'*WARNING* The current shell ({os.name}) cannot support hidden text entry.') | ||
print(f'Your password entry WILL BE VISIBLE.') | ||
print(f'If you are running a bash shell under windows, try executing this program via winpty:') | ||
print(f'>winpty python {sys.argv[0]}') | ||
password = input("Password (will be shown): ") | ||
else: | ||
password = getpass.getpass("Password: ") | ||
|
||
garth.configure(domain=domain) | ||
try: | ||
garth.login(username, password) | ||
garth.save('./garth') | ||
except Exception as e: | ||
print(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters