Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Downgrading the ImagingLibrary class to a function named get_image_fa…
…ctory, #101
- Loading branch information
Showing
2 changed files
with
12 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
from abc import ABCMeta, abstractmethod | ||
|
||
from .exceptions import OptionalPackageRequirementError | ||
from .optionals import ensure_wand | ||
|
||
|
||
class ImagingLibrary(metaclass=ABCMeta): | ||
|
||
@classmethod | ||
def get_image_factory(self): | ||
try: | ||
ensure_wand() | ||
from wand.image import Image as WandImage | ||
return WandImage | ||
except OptionalPackageRequirementError: | ||
# Raising the exception again, because currently there is only one image library | ||
# available, but after implementing the #97 the exception should be passed silently. | ||
raise | ||
def get_image_factory(): | ||
try: | ||
ensure_wand() | ||
from wand.image import Image as WandImage | ||
return WandImage | ||
except OptionalPackageRequirementError: | ||
# Raising the exception again, because currently there is only one image library | ||
# available, but after implementing the #97 the exception should be passed silently. | ||
raise | ||
|
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