mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-02 02:38:30 +02:00
22 lines
535 B
Python
22 lines
535 B
Python
from typing import IO
|
|
|
|
from source.mkw.Patch.PatchOperation import AbstractPatchOperation
|
|
|
|
|
|
Patch: any
|
|
|
|
|
|
class Special(AbstractPatchOperation):
|
|
"""
|
|
use a file defined as special in the patch to replace the current file content
|
|
"""
|
|
|
|
type = "special"
|
|
|
|
def __init__(self, name: str):
|
|
self.name = name
|
|
|
|
def patch(self, patch: "Patch", file_name: str, file_content: IO) -> (str, IO):
|
|
patch_content = patch.special_file[self.name]
|
|
patch_content.seek(0)
|
|
return file_name, patch_content
|