forked from infobyte/faraday
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconflict.py
42 lines (29 loc) · 1 KB
/
conflict.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'''
Faraday Penetration Test IDE
Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
See the file 'doc/LICENSE' for the license information
'''
class Conflict():
def __init__(self, old_object, new_object):
self.type = None
self.model_object_type = old_object.class_signature
self.first_object = old_object
self.second_object = new_object
def getFirstObject(self):
return self.first_object
def getSecondObject(self):
return self.second_object
def getType(self):
return self.type
def getModelObjectType(self):
return self.model_object_type
def resolve(self, kwargs):
return False
class ConflictUpdate(Conflict):
def __init__(self, first_object, second_object):
Conflict.__init__(self, first_object, second_object)
self.type = "Update"
def resolve(self, kwargs):
self.first_object.updateAttributes(**kwargs)
self.first_object.updateResolved(self)
return True