Atlas-Install/source/mkw/Patch/PatchOperation/Operation/Special.py

22 lines
519 B
Python

from typing import IO
from source.mkw.Patch.PatchOperation.Operation import *
Patch: any
class Special(AbstractOperation):
"""
use a file defined as special in the patch to replate 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