Skip to content

Commit 73fef23

Browse files
committed
Rewrite some crystal.model imports to avoid targeting nested packages directly
1 parent 673484f commit 73fef23

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/crystal/browser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from crystal.model import (
1616
Alias, Project, ProjectReadOnlyError, Resource, ResourceGroup, ResourceGroupSource, RootResource,
1717
)
18-
from crystal.model.project import MigrationType, NonLocalFilesystemNotSupported, NonLocalFilesystemReadOnlyError
18+
from crystal.model.project import MigrationType, NonLocalFilesystemNotSupported
1919
from crystal.progress.interface import (
2020
CancelLoadUrls, CancelSaveAs, DummyOpenProjectProgressListener,
2121
OpenProjectProgressListener,

src/crystal/model/alias.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
)
1111

1212
if TYPE_CHECKING:
13-
from crystal.model.project import Project
13+
from crystal.model import Project
1414

1515

1616
# ------------------------------------------------------------------------------
@@ -62,7 +62,7 @@ def __init__(self,
6262
* sqlite3.DatabaseError --
6363
if a database error occurred, preventing the creation of the new Alias.
6464
"""
65-
from crystal.model.project import Project, ProjectReadOnlyError
65+
from crystal.model import Project, ProjectReadOnlyError
6666

6767
project = resolve_proxy(project) # type: ignore[assignment]
6868
if not isinstance(project, Project):
@@ -120,7 +120,7 @@ def delete(self) -> None:
120120
* sqlite3.DatabaseError --
121121
if the delete fully failed due to a database error
122122
"""
123-
from crystal.model.project import ProjectReadOnlyError
123+
from crystal.model import ProjectReadOnlyError
124124

125125
if self.project.readonly:
126126
raise ProjectReadOnlyError()
@@ -149,7 +149,7 @@ def _get_target_url_prefix(self) -> str:
149149
return self._target_url_prefix
150150
@fg_affinity
151151
def _set_target_url_prefix(self, target_url_prefix: str) -> None:
152-
from crystal.model.project import ProjectReadOnlyError
152+
from crystal.model import ProjectReadOnlyError
153153

154154
if not target_url_prefix.endswith('/'):
155155
raise ValueError('target_url_prefix must end in slash (/)')
@@ -173,7 +173,7 @@ def _get_target_is_external(self) -> bool:
173173
return self._target_is_external
174174
@fg_affinity
175175
def _set_target_is_external(self, target_is_external: bool) -> None:
176-
from crystal.model.project import ProjectReadOnlyError
176+
from crystal.model import ProjectReadOnlyError
177177

178178
if not isinstance(target_is_external, bool):
179179
raise TypeError()

0 commit comments

Comments
 (0)