summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/server2/patcher.py
blob: 57d1e137dd89fd0be53b05ab61ebdc3833582782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

class Patcher(object):
  def GetPatchedFiles(self, version=None):
    '''Returns patched files as(added_files, deleted_files, modified_files)
    from the patchset specified by |version|.
    '''
    raise NotImplementedError(self.__class__)

  def GetVersion(self):
    '''Returns patch version. Returns None when nothing is patched by the
    patcher.
    '''
    raise NotImplementedError(self.__class__)

  def Apply(self, paths, file_system, binary, version=None):
    '''Apply the patch to added/modified files. Returns Future with patched
    data. Throws FileNotFoundError if |paths| contains deleted files.
    '''
    raise NotImplementedError(self.__class__)

  def GetIdentity(self):
    '''Returns a string that identifies this patch. Typically it would be the
    codereview server's ID for this patch.
    '''
    raise NotImplementedError(self.__class__)