13 for ka
,va
in a
.iteritems():
14 for kb
,vb
in b
.iteritems():
15 if ka
==kb
and vb
!=va
and vb
!='' and va
!='' and vb
!=[] and va
!=[]:
18 elif ka
==kb
and vb
==va
and vb
!='' and vb
!=[] and va
!=[]: equal
=True
19 elif ka
==kb
and isdict(vb
) and isdict(va
):
20 if equals(vb
,va
): equal
=True
22 if different
and 'title' not in difference
: print difference
23 if equal
and not different
: return True #they are exactly the same
24 else: return False #they have no relation at all
27 for sink
in sinks
: sink
.files
=sink
.get_files()
29 for file in sink
.files
:
37 print 'Creating %s to %s' % (file['title'],s
.name
)
38 file.update({'content':sink
.getContent(file)})
42 for sink
in sinks
: sink
.file = sink
.get_files()
46 get_files
=sink
.get_files()
48 if get_files
==None: continue
50 #check if file deleted or edited
51 for file in sink
.files
:
57 sink
.files
.remove(file)
60 print "Removing %s from %s" % (file['title'],s
.name
)
67 for file in get_files
:
72 if not found
: # file has been added
73 file.update({'content':sink
.getContent(file)})
74 sink
.files
.append(file)
77 print "Creating %s to %s" % (file['title'],s
.name
)