refactor: rename winart/macart to icoart/icnsart for format-oriented naming

This commit is contained in:
yyc12345 committed 2026-10-15 09:22:34 +08:00
1 parent 945d4ec68d
commit 7f3a281891
6 files changed
+26 -26

No files matched your search

+4 -4
View File
@@ -1,13 +1,13 @@
from .common import Sink from .common import Sink
from .tempart_sink import TempArtSink from .tempart_sink import TempArtSink
from .fdart_sink import FdArtSink from .fdart_sink import FdArtSink
from .winart_sink import WinArtSink from .icoart_sink import IcoArtSink
from .macart_sink import MacArtSink from .icnsart_sink import IcnsArtSink
__all__ = [ __all__ = [
"Sink", "Sink",
"TempArtSink", "TempArtSink",
"FdArtSink", "FdArtSink",
"WinArtSink", "IcoArtSink",
"MacArtSink" "IcnsArtSink"
] ]
@@ -8,12 +8,12 @@ from ...logger import HIGHLEVEL_LOGGER as LOGGER
@dataclass(frozen=True) @dataclass(frozen=True)
class MacArtSinkHint: class IcnsArtSinkHint:
kind: MacCategory kind: MacCategory
name: str name: str
class MacArtSink(Sink): class IcnsArtSink(Sink):
__kind: MacCategory __kind: MacCategory
__name: str __name: str
@@ -27,12 +27,12 @@ class MacArtSink(Sink):
def push(self, env: Environment, art: Artifact) -> None: def push(self, env: Environment, art: Artifact) -> None:
LOGGER.info( LOGGER.info(
'Saving macOS-only artifact with kind "%s" and name "%s".', 'Saving macOS ICNS artifact with kind "%s" and name "%s".',
self.__kind, self.__kind,
self.__name, self.__name,
) )
check_vart(art) check_vart(art)
artrdr.render_icns(art, env.mac_output_artifact(self.__kind, self.__name)) artrdr.render_icns(art, env.mac_output_artifact(self.__kind, self.__name))
def push_hint(self) -> MacArtSinkHint: def push_hint(self) -> IcnsArtSinkHint:
return MacArtSinkHint(self.__kind, self.__name) return IcnsArtSinkHint(self.__kind, self.__name)
@@ -8,12 +8,12 @@ from ...logger import HIGHLEVEL_LOGGER as LOGGER
@dataclass(frozen=True) @dataclass(frozen=True)
class WinArtSinkHint: class IcoArtSinkHint:
kind: WinCategory kind: WinCategory
name: str name: str
class WinArtSink(Sink): class IcoArtSink(Sink):
__kind: WinCategory __kind: WinCategory
__name: str __name: str
@@ -27,12 +27,12 @@ class WinArtSink(Sink):
def push(self, env: Environment, art: Artifact) -> None: def push(self, env: Environment, art: Artifact) -> None:
LOGGER.info( LOGGER.info(
'Saving Windows-only artifact with kind "%s" and name "%s".', 'Saving Windows ICO artifact with kind "%s" and name "%s".',
self.__kind, self.__kind,
self.__name, self.__name,
) )
check_vart(art) check_vart(art)
artrdr.render_ico(art, env.win_output_artifact(self.__kind, self.__name)) artrdr.render_ico(art, env.win_output_artifact(self.__kind, self.__name))
def push_hint(self) -> WinArtSinkHint: def push_hint(self) -> IcoArtSinkHint:
return WinArtSinkHint(self.__kind, self.__name) return IcoArtSinkHint(self.__kind, self.__name)
+4 -4
View File
@@ -5,8 +5,8 @@ from .svg_source import SvgSource
from .blender_source import BlenderSource from .blender_source import BlenderSource
from .tempart_source import TempArtSource from .tempart_source import TempArtSource
from .fdart_source import FdArtSource from .fdart_source import FdArtSource
from .winart_source import WinArtSource from .icoart_source import IcoArtSource
from .macart_source import MacArtSource from .icnsart_source import IcnsArtSource
__all__ = [ __all__ = [
@@ -17,6 +17,6 @@ __all__ = [
"BlenderSource", "BlenderSource",
"TempArtSource", "TempArtSource",
"FdArtSource", "FdArtSource",
"WinArtSource", "IcoArtSource",
"MacArtSource", "IcnsArtSource",
] ]
@@ -1,13 +1,13 @@
from .common import Source from .common import Source
from ..address import Address, AddressDomain from ..address import Address, AddressDomain
from ..environment import Environment from ..environment import Environment
from ..sink.macart_sink import MacArtSink from ..sink.icnsart_sink import IcnsArtSink
from ..utils import MacCategory from ..utils import MacCategory
from ...lowlevel import artio from ...lowlevel import artio
from ...logger import HIGHLEVEL_LOGGER as LOGGER from ...logger import HIGHLEVEL_LOGGER as LOGGER
class MacArtSource(Source): class IcnsArtSource(Source):
__kind: MacCategory __kind: MacCategory
__name: str __name: str
@@ -19,10 +19,10 @@ class MacArtSource(Source):
def address(self) -> Address: def address(self) -> Address:
return Address(AddressDomain.MacOutput, str(self.__kind), self.__name) return Address(AddressDomain.MacOutput, str(self.__kind), self.__name)
def link_to(self, env: Environment, mac_sink: MacArtSink) -> None: def link_to(self, env: Environment, mac_sink: IcnsArtSink) -> None:
sink_hint = mac_sink.push_hint() sink_hint = mac_sink.push_hint()
LOGGER.info( LOGGER.info(
'Duplicating macOS-only artifact from kind "%s" name "%s" to kind "%s" name "%s".', 'Duplicating macOS ICNS artifact from kind "%s" name "%s" to kind "%s" name "%s".',
self.__kind, self.__kind,
self.__name, self.__name,
sink_hint.kind, sink_hint.kind,
@@ -1,13 +1,13 @@
from .common import Source from .common import Source
from ..address import Address, AddressDomain from ..address import Address, AddressDomain
from ..environment import Environment from ..environment import Environment
from ..sink.winart_sink import WinArtSink from ..sink.icoart_sink import IcoArtSink
from ..utils import WinCategory from ..utils import WinCategory
from ...lowlevel import artio from ...lowlevel import artio
from ...logger import HIGHLEVEL_LOGGER as LOGGER from ...logger import HIGHLEVEL_LOGGER as LOGGER
class WinArtSource(Source): class IcoArtSource(Source):
__kind: WinCategory __kind: WinCategory
__name: str __name: str
@@ -19,10 +19,10 @@ class WinArtSource(Source):
def address(self) -> Address: def address(self) -> Address:
return Address(AddressDomain.WinOutput, str(self.__kind), self.__name) return Address(AddressDomain.WinOutput, str(self.__kind), self.__name)
def link_to(self, env: Environment, win_sink: WinArtSink) -> None: def link_to(self, env: Environment, win_sink: IcoArtSink) -> None:
sink_hint = win_sink.push_hint() sink_hint = win_sink.push_hint()
LOGGER.info( LOGGER.info(
'Duplicating Windows-only artifact from kind "%s" name "%s" to kind "%s" name "%s".', 'Duplicating Windows ICO artifact from kind "%s" name "%s" to kind "%s" name "%s".',
self.__kind, self.__kind,
self.__name, self.__name,
sink_hint.kind, sink_hint.kind,