Commit 741d0c51 authored by Nicolas Delaby's avatar Nicolas Delaby

add tag in activities, use list comprehension

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16304 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e222cfe7
...@@ -221,16 +221,15 @@ class Publication(Subscription): ...@@ -221,16 +221,15 @@ class Publication(Subscription):
""" """
Delete a subscriber for this publication Delete a subscriber for this publication
""" """
for o in self.getSubscriberList(): if subscription_url in [o.getSubscriptionUrl() for o in self.getSubscriberList()]:
if o.getSubscriptionUrl() == subscription_url: self.manage_delObjects(o.id)
self.activate().manage_delObjects(o.id)
def resetAllSubscribers(self): def resetAllSubscribers(self):
""" """
Reset all subscribers Reset all subscribers
""" """
for o in self.getSubscriberList(): for o in self.getSubscriberList():
self.activate(activity='SQLQueue').manage_delObjects(o.id) self.activate(activity='SQLQueue', tag=self.getId()).manage_delObjects(o.id)
def getConflictList(self): def getConflictList(self):
""" """
......
...@@ -859,7 +859,9 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -859,7 +859,9 @@ class SynchronizationTool( SubscriptionSynchronization,
#use activities to send send an http response #use activities to send send an http response
#LOG('sendResponse, will start sendHttpResponse, xml', DEBUG, '') #LOG('sendResponse, will start sendHttpResponse, xml', DEBUG, '')
activity = self.getActivityType(domain=domain) activity = self.getActivityType(domain=domain)
self.activate(activity=activity).sendHttpResponse(sync_id=sync_id, self.activate(activity=activity,
tag = domain.getId()).sendHttpResponse(
sync_id=sync_id,
to_url=to_url, to_url=to_url,
xml=xml, xml=xml,
domain_path=domain.getPath(), domain_path=domain.getPath(),
...@@ -938,7 +940,8 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -938,7 +940,8 @@ class SynchronizationTool( SubscriptionSynchronization,
result = url_file.read() result = url_file.read()
except socket.error, msg: except socket.error, msg:
activity = self.getActivityType(domain=domain) activity = self.getActivityType(domain=domain)
self.activate(activity=activity).sendHttpResponse( self.activate(activity=activity,
tag = domain.getId()).sendHttpResponse(
to_url=to_url, to_url=to_url,
sync_id=sync_id, sync_id=sync_id,
xml=xml, xml=xml,
...@@ -974,7 +977,9 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -974,7 +977,9 @@ class SynchronizationTool( SubscriptionSynchronization,
user = uf.getUserById(user_id).__of__(uf) user = uf.getUserById(user_id).__of__(uf)
newSecurityManager(None, user) newSecurityManager(None, user)
activity = self.getActivityType(domain=subscription) activity = self.getActivityType(domain=subscription)
subscription.activate(activity=activity).SubSync(subscription.getPath()) subscription.activate(activity=activity,
tag = subscription.getId()
).SubSync(subscription.getPath())
security.declarePublic('readResponse') security.declarePublic('readResponse')
def readResponse(self, text='', sync_id=None, to_url=None, from_url=None): def readResponse(self, text='', sync_id=None, to_url=None, from_url=None):
...@@ -1033,7 +1038,9 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -1033,7 +1038,9 @@ class SynchronizationTool( SubscriptionSynchronization,
publication.getTitle()==sync_id: publication.getTitle()==sync_id:
if publication.getActivityEnabled(): if publication.getActivityEnabled():
#use activities to send SyncML data. #use activities to send SyncML data.
publication.activate(activity='SQLDict').PubSync( activity = self.getActivityType(domain=publication)
publication.activate(activity=activity,
tag=publication.getId()).PubSync(
publication.getPath(), publication.getPath(),
text) text)
return ' ' return ' '
...@@ -1050,7 +1057,9 @@ class SynchronizationTool( SubscriptionSynchronization, ...@@ -1050,7 +1057,9 @@ class SynchronizationTool( SubscriptionSynchronization,
subscription.getTitle() == sync_id: subscription.getTitle() == sync_id:
subscription_path = subscription.getPath() subscription_path = subscription.getPath()
activity = self.getActivityType(domain=subscription) activity = self.getActivityType(domain=subscription)
self.activate(activity=activity).SubSync(subscription_path, self.activate(activity=activity,
tag=subscription.getId()).SubSync(
subscription_path,
text) text)
return ' ' return ' '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment