Skip to content

Commit

Permalink
update: bring in upstream changes from pyicloud
Browse files Browse the repository at this point in the history
  • Loading branch information
cfurrow committed Dec 9, 2023
1 parent 655f63b commit bb7ba68
Show file tree
Hide file tree
Showing 16 changed files with 1,517 additions and 914 deletions.
2 changes: 1 addition & 1 deletion src/icloudpd/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def authenticate_(
client_id=client_id,
)
break
except pyicloud_ipd.exceptions.NoStoredPasswordAvailable:
except pyicloud_ipd.exceptions.PyiCloudNoStoredPasswordAvailableException:
# Prompt for password if not stored in PyiCloud's keyring
password = click.prompt("iCloud Password", hide_input=True)

Expand Down
4 changes: 2 additions & 2 deletions src/icloudpd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from tzlocal import get_localzone
from pyicloud_ipd import PyiCloudService

from pyicloud_ipd.exceptions import PyiCloudAPIResponseError
from pyicloud_ipd.exceptions import PyiCloudAPIResponseException
from pyicloud_ipd.services.photos import PhotoAsset

from icloudpd.authentication import authenticator, TwoStepAuthRequiredError
Expand Down Expand Up @@ -788,7 +788,7 @@ def core(
logger.error("Unknown library: %s", library)
return 1
photos = library_object.albums[album]
except PyiCloudAPIResponseError as err:
except PyiCloudAPIResponseException as err:
# For later: come up with a nicer message to the user. For now take the
# exception text
logger.error("error?? %s", err)
Expand Down
1 change: 1 addition & 0 deletions src/pyicloud_ipd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""The pyiCloud library."""
import logging
from pyicloud_ipd.base import PyiCloudService

Expand Down
20 changes: 12 additions & 8 deletions src/pyicloud_ipd/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Library base file."""
from uuid import uuid1
import inspect
import json
Expand All @@ -10,11 +11,10 @@
import getpass

from pyicloud_ipd.exceptions import (
PyiCloudConnectionException,
PyiCloudFailedLoginException,
PyiCloudAPIResponseError,
PyiCloud2SARequiredError,
PyiCloudServiceNotActivatedErrror
PyiCloudAPIResponseException,
PyiCloud2SARequiredException,
PyiCloudServiceNotActivatedException,
)
from pyicloud_ipd.services import (
FindMyiPhoneServiceManager,
Expand All @@ -23,10 +23,12 @@
ContactsService,
RemindersService,
PhotosService,
AccountService
AccountService,
DriveService,
)
from pyicloud_ipd.utils import get_password_from_keyring


LOGGER = logging.getLogger(__name__)

HEADER_DATA = {
Expand All @@ -39,13 +41,15 @@


class PyiCloudPasswordFilter(logging.Filter):
"""Password log hider."""

def __init__(self, password):
self.password = password
super().__init__(password)

def filter(self, record):
message = record.getMessage()
if self.password in message:
record.msg = message.replace(self.password, "*" * 8)
if self.name in message:
record.msg = message.replace(self.name, "*" * 8)
record.args = []

return True
Expand Down
Loading

0 comments on commit bb7ba68

Please sign in to comment.