Skip to content

Commit

Permalink
move non-public modules to b2sdk._internal
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Mar 28, 2024
1 parent e26d007 commit ea0daf0
Show file tree
Hide file tree
Showing 138 changed files with 1,133 additions and 1,116 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/account_info/__init__.py
# File: b2sdk/_internal/account_info/__init__.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/account_info/abstract.py
# File: b2sdk/_internal/account_info/abstract.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -11,9 +11,9 @@

from abc import abstractmethod

from b2sdk.account_info import exception
from b2sdk.raw_api import ALL_CAPABILITIES
from b2sdk.utils import B2TraceMetaAbstract, limit_trace_arguments
from b2sdk._internal.account_info import exception
from b2sdk._internal.raw_api import ALL_CAPABILITIES
from b2sdk._internal.utils import B2TraceMetaAbstract, limit_trace_arguments


class AbstractAccountInfo(metaclass=B2TraceMetaAbstract):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/account_info/exception.py
# File: b2sdk/_internal/account_info/exception.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -11,7 +11,7 @@

from abc import ABCMeta

from ..exception import B2Error
from b2sdk._internal.exception import B2Error


class AccountInfoError(B2Error, metaclass=ABCMeta):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/account_info/in_memory.py
# File: b2sdk/_internal/account_info/in_memory.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/account_info/sqlite_account_info.py
# File: b2sdk/_internal/account_info/sqlite_account_info.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/account_info/stub.py
# File: b2sdk/_internal/account_info/stub.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/account_info/upload_url_pool.py
# File: b2sdk/_internal/account_info/upload_url_pool.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
2 changes: 1 addition & 1 deletion b2sdk/api.py → b2sdk/_internal/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/api.py
# File: b2sdk/_internal/api.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
4 changes: 2 additions & 2 deletions b2sdk/api_config.py → b2sdk/_internal/api_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/api_config.py
# File: b2sdk/_internal/api_config.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -13,7 +13,7 @@

import requests

from .raw_api import AbstractRawApi, B2RawHTTPApi
from b2sdk._internal.raw_api import AbstractRawApi, B2RawHTTPApi


class B2HttpApiConfig:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/application_key.py
# File: b2sdk/_internal/application_key.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand Down
5 changes: 3 additions & 2 deletions b2sdk/b2http.py → b2sdk/_internal/b2http.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/b2http.py
# File: b2sdk/_internal/b2http.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down Expand Up @@ -29,6 +29,8 @@
import requests
from requests.adapters import HTTPAdapter

from b2sdk.version import USER_AGENT

from .api_config import DEFAULT_HTTP_API_CONFIG, B2HttpApiConfig
from .exception import (
B2ConnectionError,
Expand All @@ -46,7 +48,6 @@
)
from .requests import NotDecompressingResponse
from .utils.typing import JSON
from .version import USER_AGENT

LOCALE_LOCK = threading.Lock()
logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/bounded_queue_executor.py
# File: b2sdk/_internal/bounded_queue_executor.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
25 changes: 13 additions & 12 deletions b2sdk/bucket.py → b2sdk/_internal/bucket.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/bucket.py
# File: b2sdk/_internal/bucket.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -16,6 +16,18 @@
from contextlib import suppress
from typing import Sequence

from b2sdk._internal.progress import AbstractProgressListener, DoNothingProgressListener
from b2sdk._internal.raw_api import LifecycleRule
from b2sdk._internal.transfer.emerge.executor import AUTO_CONTENT_TYPE
from b2sdk._internal.utils import (
B2TraceMeta,
Sha1HexDigest,
b2_url_encode,
disable_trace,
limit_trace_arguments,
validate_b2_file_name,
)

from .encryption.setting import EncryptionSetting, EncryptionSettingFactory
from .encryption.types import EncryptionMode
from .exception import (
Expand All @@ -36,23 +48,12 @@
from .file_version import DownloadVersion, FileVersion
from .filter import Filter, FilterMatcher
from .http_constants import LIST_FILE_NAMES_MAX_LIMIT
from .progress import AbstractProgressListener, DoNothingProgressListener
from .raw_api import LifecycleRule
from .replication.setting import ReplicationConfiguration, ReplicationConfigurationFactory
from .transfer.emerge.executor import AUTO_CONTENT_TYPE
from .transfer.emerge.unbound_write_intent import UnboundWriteIntentGenerator
from .transfer.emerge.write_intent import WriteIntent
from .transfer.inbound.downloaded_file import DownloadedFile
from .transfer.outbound.copy_source import CopySource
from .transfer.outbound.upload_source import UploadMode, UploadSourceBytes, UploadSourceLocalFile
from .utils import (
B2TraceMeta,
Sha1HexDigest,
b2_url_encode,
disable_trace,
limit_trace_arguments,
validate_b2_file_name,
)

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions b2sdk/cache.py → b2sdk/_internal/cache.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/cache.py
# File: b2sdk/_internal/cache.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -13,7 +13,7 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from b2sdk.account_info.abstract import AbstractAccountInfo
from b2sdk._internal.account_info.abstract import AbstractAccountInfo


class AbstractCache(metaclass=ABCMeta):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/encryption/__init__.py
# File: b2sdk/_internal/encryption/__init__.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/encryption/setting.py
# File: b2sdk/_internal/encryption/setting.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -14,8 +14,9 @@
import urllib
import urllib.parse

from ..http_constants import SSE_C_KEY_ID_FILE_INFO_KEY_NAME, SSE_C_KEY_ID_HEADER
from ..utils import b64_of_bytes, md5_of_bytes
from b2sdk._internal.http_constants import SSE_C_KEY_ID_FILE_INFO_KEY_NAME, SSE_C_KEY_ID_HEADER
from b2sdk._internal.utils import b64_of_bytes, md5_of_bytes

from .types import (
ENCRYPTION_MODES_WITH_MANDATORY_ALGORITHM,
ENCRYPTION_MODES_WITH_MANDATORY_KEY,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/encryption/types.py
# File: b2sdk/_internal/encryption/types.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand Down
2 changes: 1 addition & 1 deletion b2sdk/exception.py → b2sdk/_internal/exception.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/exception.py
# File: b2sdk/_internal/exception.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand Down
2 changes: 1 addition & 1 deletion b2sdk/file_lock.py → b2sdk/_internal/file_lock.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/file_lock.py
# File: b2sdk/_internal/file_lock.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand Down
11 changes: 6 additions & 5 deletions b2sdk/file_version.py → b2sdk/_internal/file_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/file_version.py
# File: b2sdk/_internal/file_version.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -14,14 +14,15 @@
from copy import deepcopy
from typing import TYPE_CHECKING, Any

from b2sdk._internal.progress import AbstractProgressListener
from b2sdk._internal.utils import Sha1HexDigest, b2_url_decode
from b2sdk._internal.utils.http_date import parse_http_date
from b2sdk._internal.utils.range_ import Range

from .encryption.setting import EncryptionSetting, EncryptionSettingFactory
from .file_lock import NO_RETENTION_FILE_SETTING, FileRetentionSetting, LegalHold
from .http_constants import FILE_INFO_HEADER_PREFIX_LOWER, LARGE_FILE_SHA1, SRC_LAST_MODIFIED_MILLIS
from .progress import AbstractProgressListener
from .replication.types import ReplicationStatus
from .utils import Sha1HexDigest, b2_url_decode
from .utils.http_date import parse_http_date
from .utils.range_ import Range

if TYPE_CHECKING:
from .api import B2Api
Expand Down
2 changes: 1 addition & 1 deletion b2sdk/filter.py → b2sdk/_internal/filter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/filter.py
# File: b2sdk/_internal/filter.py
#
# Copyright 2024 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/http_constants.py
# File: b2sdk/_internal/http_constants.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/included_sources.py
# File: b2sdk/_internal/included_sources.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/transfer/emerge/__init__.py
# File: b2sdk/_internal/large_file/__init__.py
#
# Copyright 2020 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/large_file/part.py
# File: b2sdk/_internal/large_file/part.py
#
# Copyright 2020 Backblaze Inc. All Rights Reserved.
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/large_file/services.py
# File: b2sdk/_internal/large_file/services.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -9,11 +9,11 @@
######################################################################
from __future__ import annotations

from b2sdk.encryption.setting import EncryptionSetting
from b2sdk.file_lock import FileRetentionSetting, LegalHold
from b2sdk.file_version import FileIdAndName
from b2sdk.large_file.part import PartFactory
from b2sdk.large_file.unfinished_large_file import UnfinishedLargeFile
from b2sdk._internal.encryption.setting import EncryptionSetting
from b2sdk._internal.file_lock import FileRetentionSetting, LegalHold
from b2sdk._internal.file_version import FileIdAndName
from b2sdk._internal.large_file.part import PartFactory
from b2sdk._internal.large_file.unfinished_large_file import UnfinishedLargeFile


class LargeFileServices:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/large_file/unfinished_large_file.py
# File: b2sdk/_internal/large_file/unfinished_large_file.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -11,9 +11,9 @@

import datetime as dt

from b2sdk.encryption.setting import EncryptionSettingFactory
from b2sdk.file_lock import FileRetentionSetting, LegalHold
from b2sdk.utils.http_date import parse_http_date
from b2sdk._internal.encryption.setting import EncryptionSettingFactory
from b2sdk._internal.file_lock import FileRetentionSetting, LegalHold
from b2sdk._internal.utils.http_date import parse_http_date


class UnfinishedLargeFile:
Expand Down
4 changes: 2 additions & 2 deletions b2sdk/progress.py → b2sdk/_internal/progress.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
######################################################################
#
# File: b2sdk/progress.py
# File: b2sdk/_internal/progress.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
Expand All @@ -12,7 +12,7 @@
import time
from abc import ABCMeta, abstractmethod

from .utils.escape import escape_control_chars
from b2sdk._internal.utils.escape import escape_control_chars

try:
from tqdm import tqdm # displays a nice progress bar
Expand Down
Loading

0 comments on commit ea0daf0

Please sign in to comment.