'`self.contents` and `self.replacements` are initialized here, in
order to keep the rest of the functions of this class with the same
signature as `EditPlugin.get_editor()`, making mocking easier.
- `contents`: string with the contents of the file to be used for
`overwrite_contents()`
- `replacement`: dict with the in-place replacements to be used for
`replace_contents()`, in the form {\'previous string\': \'new string\'}
TODO: check if it can be solved more elegantly with a decorator'

def __init__(self, contents=None, replacements=None):

    self.contents = contents
    self.replacements = replacements
    self.action = self.overwrite_contents
    if replacements:
        self.action = self.replace_contents
