Merge lp:~jfb-tempo-consulting/unifield-wm/sync-bklg-56 into lp:unifield-wm/sync

Proposed by jftempo
Status: Merged
Merged at revision: 565
Proposed branch: lp:~jfb-tempo-consulting/unifield-wm/sync-bklg-56
Merge into: lp:unifield-wm/sync
Diff against target: 68 lines (+19/-8)
2 files modified
sync_client/monitor.py (+11/-4)
sync_client/sync_client.py (+8/-4)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-wm/sync-bklg-56
Reviewer Review Type Date Requested Status
UniField Sync Reviewer Pending
Review via email: mp+259896@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'sync_client/monitor.py'
--- sync_client/monitor.py 2015-02-18 08:04:40 +0000
+++ sync_client/monitor.py 2015-05-22 08:47:06 +0000
@@ -211,9 +211,16 @@
211 def _is_syncing(self, cr, uid, ids, name, arg, context=None):211 def _is_syncing(self, cr, uid, ids, name, arg, context=None):
212 res = dict.fromkeys(ids, "not_syncing")212 res = dict.fromkeys(ids, "not_syncing")
213 is_syncing = self.pool.get('sync.client.entity').is_syncing()213 is_syncing = self.pool.get('sync.client.entity').is_syncing()
214 for monitor in self.browse(cr, uid, ids, context=context):214 max_id = 0
215 if monitor.status == 'in-progress' and is_syncing:215 if is_syncing:
216 res[monitor.id] = "syncing"216 for monitor in self.browse(cr, uid, ids, context=context):
217 if monitor.status == 'in-progress' and monitor.id > max_id:
218 max_id = monitor.id
219 if max_id:
220 if self.pool.get('sync.client.entity').aborting:
221 res[max_id] = "aborting"
222 else:
223 res[max_id] = "syncing"
217224
218 return res225 return res
219226
@@ -240,7 +247,7 @@
240 'msg_push_send' : fields.selection(status_dict.items(), string="MP Send", readonly=True),247 'msg_push_send' : fields.selection(status_dict.items(), string="MP Send", readonly=True),
241 'status' : fields.selection(status_dict.items(), string="Status", readonly=True),248 'status' : fields.selection(status_dict.items(), string="Status", readonly=True),
242 'error' : fields.text("Messages", readonly=True),249 'error' : fields.text("Messages", readonly=True),
243 'state' : fields.function(_is_syncing, method=True, type='selection', string="Is Syncing", selection=[('syncing', 'Syncing'), ('not_syncing', 'Done')]),250 'state' : fields.function(_is_syncing, method=True, type='selection', string="Is Syncing", selection=[('syncing', 'Syncing'), ('not_syncing', 'Done'), ('aborting', 'Aborting')]),
244251
245 'instance_id': fields.many2one('msf.instance', 'Instance', select=1),252 'instance_id': fields.many2one('msf.instance', 'Instance', select=1),
246 'my_instance': fields.function(_get_my_instance, method=True, type='boolean', fnct_search=_search_my_instance, string="My Instance"),253 'my_instance': fields.function(_get_my_instance, method=True, type='boolean', fnct_search=_search_my_instance, string="My Instance"),
247254
=== modified file 'sync_client/sync_client.py'
--- sync_client/sync_client.py 2015-05-06 13:52:09 +0000
+++ sync_client/sync_client.py 2015-05-22 08:47:06 +0000
@@ -957,6 +957,7 @@
957 raise already_syncing_error957 raise already_syncing_error
958 return True958 return True
959 self.sync_lock.release()959 self.sync_lock.release()
960 self.aborting = False
960 return False961 return False
961962
962 def get_status(self, cr, uid, context=None):963 def get_status(self, cr, uid, context=None):
@@ -964,6 +965,8 @@
964 return "Not Connected"965 return "Not Connected"
965966
966 if self.is_syncing():967 if self.is_syncing():
968 if self.aborting:
969 return "Aborting..."
967 return "Syncing..."970 return "Syncing..."
968971
969 monitor = self.pool.get("sync.monitor")972 monitor = self.pool.get("sync.monitor")
@@ -976,10 +979,11 @@
976979
977 def interrupt_sync(self, cr, uid, context=None):980 def interrupt_sync(self, cr, uid, context=None):
978 if self.is_syncing():981 if self.is_syncing():
979 try:982 #try:
980 self._renew_sync_lock()983 # self._renew_sync_lock()
981 except StandardError:984 #except StandardError:
982 return False985 # return False
986 self.aborting = True
983 self.sync_cursor.close()987 self.sync_cursor.close()
984 return True988 return True
985989

Subscribers

People subscribed via source and target branches

to all changes: