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
1=== modified file 'sync_client/monitor.py'
2--- sync_client/monitor.py 2015-02-18 08:04:40 +0000
3+++ sync_client/monitor.py 2015-05-22 08:47:06 +0000
4@@ -211,9 +211,16 @@
5 def _is_syncing(self, cr, uid, ids, name, arg, context=None):
6 res = dict.fromkeys(ids, "not_syncing")
7 is_syncing = self.pool.get('sync.client.entity').is_syncing()
8- for monitor in self.browse(cr, uid, ids, context=context):
9- if monitor.status == 'in-progress' and is_syncing:
10- res[monitor.id] = "syncing"
11+ max_id = 0
12+ if is_syncing:
13+ for monitor in self.browse(cr, uid, ids, context=context):
14+ if monitor.status == 'in-progress' and monitor.id > max_id:
15+ max_id = monitor.id
16+ if max_id:
17+ if self.pool.get('sync.client.entity').aborting:
18+ res[max_id] = "aborting"
19+ else:
20+ res[max_id] = "syncing"
21
22 return res
23
24@@ -240,7 +247,7 @@
25 'msg_push_send' : fields.selection(status_dict.items(), string="MP Send", readonly=True),
26 'status' : fields.selection(status_dict.items(), string="Status", readonly=True),
27 'error' : fields.text("Messages", readonly=True),
28- 'state' : fields.function(_is_syncing, method=True, type='selection', string="Is Syncing", selection=[('syncing', 'Syncing'), ('not_syncing', 'Done')]),
29+ 'state' : fields.function(_is_syncing, method=True, type='selection', string="Is Syncing", selection=[('syncing', 'Syncing'), ('not_syncing', 'Done'), ('aborting', 'Aborting')]),
30
31 'instance_id': fields.many2one('msf.instance', 'Instance', select=1),
32 'my_instance': fields.function(_get_my_instance, method=True, type='boolean', fnct_search=_search_my_instance, string="My Instance"),
33
34=== modified file 'sync_client/sync_client.py'
35--- sync_client/sync_client.py 2015-05-06 13:52:09 +0000
36+++ sync_client/sync_client.py 2015-05-22 08:47:06 +0000
37@@ -957,6 +957,7 @@
38 raise already_syncing_error
39 return True
40 self.sync_lock.release()
41+ self.aborting = False
42 return False
43
44 def get_status(self, cr, uid, context=None):
45@@ -964,6 +965,8 @@
46 return "Not Connected"
47
48 if self.is_syncing():
49+ if self.aborting:
50+ return "Aborting..."
51 return "Syncing..."
52
53 monitor = self.pool.get("sync.monitor")
54@@ -976,10 +979,11 @@
55
56 def interrupt_sync(self, cr, uid, context=None):
57 if self.is_syncing():
58- try:
59- self._renew_sync_lock()
60- except StandardError:
61- return False
62+ #try:
63+ # self._renew_sync_lock()
64+ #except StandardError:
65+ # return False
66+ self.aborting = True
67 self.sync_cursor.close()
68 return True
69

Subscribers

People subscribed via source and target branches

to all changes: