-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use bootstrap as component framework and replace all templates with styled elements - Add htmx response-targets for error handling - Add custom js to open bootstrap toast - Add cancel and resume feature - Fix lint errors - Fix counter - Fix typings - Fix formatting
- Loading branch information
Showing
32 changed files
with
506 additions
and
34 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,91 @@ | ||
from typing import Callable, Dict, Optional, Sequence, Tuple | ||
|
||
from pyicloud_ipd.file_match import FileMatchPolicy | ||
from pyicloud_ipd.raw_policy import RawTreatmentPolicy | ||
from pyicloud_ipd.version_size import AssetVersionSize, LivePhotoVersionSize | ||
|
||
from icloudpd.mfa_provider import MFAProvider | ||
|
||
|
||
class Config: | ||
def __init__( | ||
self, | ||
directory: Optional[str], | ||
username: str, | ||
auth_only: bool, | ||
cookie_directory: str, | ||
size: Sequence[AssetVersionSize], | ||
live_photo_size: LivePhotoVersionSize, | ||
recent: Optional[int], | ||
until_found: Optional[int], | ||
album: str, | ||
list_albums: bool, | ||
library: str, | ||
list_libraries: bool, | ||
skip_videos: bool, | ||
skip_live_photos: bool, | ||
force_size: bool, | ||
auto_delete: bool, | ||
only_print_filenames: bool, | ||
folder_structure: str, | ||
set_exif_datetime: bool, | ||
smtp_username: Optional[str], | ||
smtp_host: str, | ||
smtp_port: int, | ||
smtp_no_tls: bool, | ||
notification_email: Optional[str], | ||
notification_email_from: Optional[str], | ||
log_level: str, | ||
no_progress_bar: bool, | ||
notification_script: Optional[str], | ||
threads_num: int, | ||
delete_after_download: bool, | ||
domain: str, | ||
watch_with_interval: Optional[int], | ||
dry_run: bool, | ||
raw_policy: RawTreatmentPolicy, | ||
password_providers: Dict[ | ||
str, Tuple[Callable[[str], Optional[str]], Callable[[str, str], None]] | ||
], | ||
file_match_policy: FileMatchPolicy, | ||
mfa_provider: MFAProvider, | ||
use_os_locale: bool, | ||
): | ||
self.directory = directory | ||
self.username = username | ||
self.auth_only = auth_only | ||
self.cookie_directory = cookie_directory | ||
self.size = " ".join(str(e) for e in size) | ||
self.live_photo_size = live_photo_size | ||
self.recent = recent | ||
self.until_found = until_found | ||
self.album = album | ||
self.list_albums = list_albums | ||
self.library = library | ||
self.list_libraries = list_libraries | ||
self.skip_videos = skip_videos | ||
self.skip_live_photos = skip_live_photos | ||
self.force_size = force_size | ||
self.auto_delete = auto_delete | ||
self.only_print_filenames = only_print_filenames | ||
self.folder_structure = folder_structure | ||
self.set_exif_datetime = set_exif_datetime | ||
self.smtp_username = smtp_username | ||
self.smtp_host = smtp_host | ||
self.smtp_port = smtp_port | ||
self.smtp_no_tls = smtp_no_tls | ||
self.notification_email = notification_email | ||
self.notification_email_from = notification_email_from | ||
self.log_level = log_level | ||
self.no_progress_bar = no_progress_bar | ||
self.notification_script = notification_script | ||
self.threads_num = threads_num | ||
self.delete_after_download = delete_after_download | ||
self.domain = domain | ||
self.watch_with_interval = watch_with_interval | ||
self.dry_run = dry_run | ||
self.raw_policy = raw_policy | ||
self.password_providers = " ".join(str(e) for e in password_providers) | ||
self.file_match_policy = file_match_policy | ||
self.mfa_provider = mfa_provider | ||
self.use_os_locale = use_os_locale |
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 |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
class MFAProvider(Enum): | ||
CONSOLE = "console" | ||
WEBUI = "webui" | ||
|
||
def __str__(self) -> str: | ||
return self.name |
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,55 @@ | ||
import datetime | ||
|
||
|
||
class Progress: | ||
def __init__(self) -> None: | ||
self._photos_count = 0 | ||
self._photos_counter = 0 | ||
self.photos_percent = 0 | ||
self.photos_last_message = "" | ||
self.waiting_readable = "" | ||
self.resume = False | ||
self.cancel = False | ||
self._waiting = 0 | ||
|
||
@property | ||
def waiting(self) -> int: | ||
return self._waiting | ||
|
||
@waiting.setter | ||
def waiting(self, waiting: int) -> None: | ||
self._waiting = waiting | ||
self.waiting_readable = str(datetime.timedelta(seconds=waiting)) | ||
|
||
@property | ||
def photos_count(self) -> int: | ||
return self._photos_count | ||
|
||
@photos_count.setter | ||
def photos_count(self, photos_count: int) -> None: | ||
self._photos_count = photos_count | ||
if self.photos_count != 0: | ||
self.photos_percent = round(100 / self.photos_count * self.photos_counter) | ||
else: | ||
self.photos_percent = 0 | ||
|
||
@property | ||
def photos_counter(self) -> int: | ||
return self._photos_counter | ||
|
||
@photos_counter.setter | ||
def photos_counter(self, photos_counter: int) -> None: | ||
self._photos_counter = photos_counter | ||
if self.photos_count != 0: | ||
self.photos_percent = round(100 / self.photos_count * self.photos_counter) | ||
else: | ||
self.photos_percent = 0 | ||
|
||
def reset(self) -> None: | ||
self._photos_count = 0 | ||
self._photos_counter = 0 | ||
self.photos_percent = 0 | ||
self._waiting = 0 | ||
self.waiting_readable = "" | ||
self.resume = False | ||
self.cancel = False |
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
6 changes: 6 additions & 0 deletions
6
src/icloudpd/server/static/bootstrap/5.3.3/css/bootstrap-grid.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
src/icloudpd/server/static/bootstrap/5.3.3/css/bootstrap-grid.rtl.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.