Implement executing RecodeInstruction
This commit is contained in:
parent
fa3df3d2e2
commit
4c6ef77a27
@ -15,4 +15,8 @@ class RecodeInstruction(Instruction):
|
|||||||
new_encoding: str
|
new_encoding: str
|
||||||
|
|
||||||
def __call__(self) -> None:
|
def __call__(self) -> None:
|
||||||
raise NotImplementedError()
|
with self.path.open("r", encoding=self.old_encoding) as f:
|
||||||
|
file_contents = f.read()
|
||||||
|
|
||||||
|
with self.path.open("w", encoding=self.new_encoding) as f:
|
||||||
|
f.write(file_contents)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user