14 for ka,va in a.iteritems():
15 for kb,vb in b.iteritems():
16 if ka==kb and vb!=va and vb!='' and va!='':
18 elif ka==kb and vb==va and vb!='':
20 elif ka==kb and isdict(vb) and isdict(va):
25 if equal and not different: return True #they are exactly the same
26 else: return False #they have no relation at all
29 for sink in sinks: sink.files=sink.get_files()
31 for file in sink.files:
39 print 'creating %s to %s' % (file['title'],s.name)
40 file.update({'content':sink.getContent(file)})
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)
79 s.files.append(file)=======
92 for ka,va in a.iteritems():
93 for kb,vb in b.iteritems():
94 if ka==kb and vb!=va and vb!='' and va!='':
96 elif ka==kb and vb==va and vb!='':
98 elif ka==kb and isdict(vb) and isdict(va):
103 if equal and not different: return True #they are exactly the same
104 else: return False #they have no relation at all
107 for sink in sinks: sink.files=sink.get_files()
109 for file in sink.files:
111 if s.name!=sink.name:
116 elif f['title']==file['title'] and f['title']!='':
118 print '%s must need updating...' % f['title']
120 print 'creating %s to %s' % (file['title'],s.name)
121 file.update({'content':sink.getContent(file)})
127 get_files=sink.get_files()
129 #check if file deleted or edited
130 for file in sink.files:
136 sink.files.remove(file)
138 if s.name!=sink.name:
139 print "removing %s from %s" % (file['title'],s.name)
145 #check if files added
146 for file in get_files:
151 if not found: # file has been added
152 file.update({'content':sink.getContent(file)})
153 sink.files.append(file)
155 if s.name!=sink.name:
156 print "creating %s to %s" % (file['title'],s.name)
158 s.files.append(file)>>>>>>> .r14