pydoto-cli

Simple ToDo-like application, that just works. Add any tasks without closing your terminal.
git clone https://git.nfu.su/pydoto-cli.git
Log | Files | Refs | README

cloud.py (642B)


      1 import dropbox as dbx
      2 from dropbox.dropbox_client import BadInputException
      3 from dropbox.exceptions import AuthError
      4 
      5 
      6 class Cloud:
      7     def __init__(self):
      8         pass
      9 
     10     @classmethod
     11     def dbx_auth(cls, key):
     12         if key is None:
     13             print("!=> The KEY field is empty")
     14             return
     15 
     16         try:
     17             drbx = dbx.Dropbox(key)
     18             drbx_acc_info = drbx.users_get_current_account()
     19         except (AuthError, BadInputException) as e:
     20             print(f"!=> Can't log in into your Dropbox acccount: {e}")
     21             return
     22 
     23         print(f"Good Day, {drbx_acc_info.name.display_name}!")
     24         return drbx