Commit 207b4ca5 authored by Sebastien Robin's avatar Sebastien Robin

small cleanup


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@711 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9390a834
...@@ -88,7 +88,7 @@ class SubscriptionSynchronization(XMLSyncUtils): ...@@ -88,7 +88,7 @@ class SubscriptionSynchronization(XMLSyncUtils):
response = None #check if subsync replies to this messages response = None #check if subsync replies to this messages
subscription = self.getSubscription(id) subscription = self.getSubscription(id)
if msg==None: if msg==None and (subscription.getSubscriptionUrl()).find('file')>=0:
msg = self.readResponse(sync_id=id,from_url=subscription.getSubscriptionUrl()) msg = self.readResponse(sync_id=id,from_url=subscription.getSubscriptionUrl())
if msg==None: if msg==None:
response = self.SubSyncInit(self.getSubscription(id)) response = self.SubSyncInit(self.getSubscription(id))
...@@ -112,11 +112,4 @@ class SubscriptionSynchronization(XMLSyncUtils): ...@@ -112,11 +112,4 @@ class SubscriptionSynchronization(XMLSyncUtils):
return self.SyncModif(subscription, xml_client) return self.SyncModif(subscription, xml_client)
#def SubLastSync(self, subscription, xml_client=None, RESPONSE=None):
# """
# Now we can read the last response of the server
# """
# self.SyncModif(subscription,xml_client)
# if RESPONSE is not None:
# RESPONSE.redirect('manageSubscriptions')
...@@ -45,8 +45,7 @@ from SubscriptionSynchronization import SubscriptionSynchronization ...@@ -45,8 +45,7 @@ from SubscriptionSynchronization import SubscriptionSynchronization
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.User import UnrestrictedUser from AccessControl.User import UnrestrictedUser
#import sys from Acquisition import aq_base
#import StringIO
import urllib import urllib
import urllib2 import urllib2
import os import os
...@@ -551,6 +550,7 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -551,6 +550,7 @@ class SynchronizationTool( UniqueObject, SimpleItem,
if domain.domain_type == self.PUB: if domain.domain_type == self.PUB:
return None return None
# we will send an http response # we will send an http response
domain = aq_base(domain)
self.activate(activity='RAMQueue').sendHttpResponse(sync_id=sync_id, self.activate(activity='RAMQueue').sendHttpResponse(sync_id=sync_id,
to_url=to_url, to_url=to_url,
xml=xml, domain=domain) xml=xml, domain=domain)
...@@ -612,8 +612,6 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -612,8 +612,6 @@ class SynchronizationTool( UniqueObject, SimpleItem,
uf = self.acl_users uf = self.acl_users
user = UnrestrictedUser('syncml','syncml',['Manager','Member'],'') user = UnrestrictedUser('syncml','syncml',['Manager','Member'],'')
newSecurityManager(None, user) newSecurityManager(None, user)
get_transaction().commit()
#self.activate(activity='RAMQueue').SubSync(sync_id,result)
self.activate(activity='RAMQueue').readResponse(sync_id=sync_id,text=result) self.activate(activity='RAMQueue').readResponse(sync_id=sync_id,text=result)
security.declarePublic('sync') security.declarePublic('sync')
......
...@@ -792,7 +792,8 @@ class XMLSyncUtilsMixin(SyncCode, ActiveObject): ...@@ -792,7 +792,8 @@ class XMLSyncUtilsMixin(SyncCode, ActiveObject):
signature.setStatus(self.PARTIAL) signature.setStatus(self.PARTIAL)
#LOG('SyncModif',0,'setPartialXML: %s' % str(previous_partial)) #LOG('SyncModif',0,'setPartialXML: %s' % str(previous_partial))
previous_partial = signature.getPartialXML() or '' previous_partial = signature.getPartialXML() or ''
previous_partial += partial_data if previous_partial.find(partial_data)<0:
previous_partial += partial_data
signature.setPartialXML(previous_partial) signature.setPartialXML(previous_partial)
#LOG('SyncModif',0,'previous_partial: %s' % str(previous_partial)) #LOG('SyncModif',0,'previous_partial: %s' % str(previous_partial))
LOG('SyncModif',0,'waiting more data for :%s' % signature.getId()) LOG('SyncModif',0,'waiting more data for :%s' % signature.getId())
......
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