[Zope-Checkins] CVS: Zope3/lib/python/Zope/I18n/Views/Browser - ExportImport.py:1.2 Synchronize.py:1.2 Translate.py:1.4

Jim Fulton jim@zope.com
Tue, 18 Jun 2002 10:47:36 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/I18n/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv6342/lib/python/Zope/I18n/Views/Browser

Modified Files:
	ExportImport.py Synchronize.py Translate.py 
Log Message:
Renamed request getResponse method to read-only response property.


=== Zope3/lib/python/Zope/I18n/Views/Browser/ExportImport.py 1.1 => 1.2 ===
 
     def exportMessages(self, domains, languages):
-        self.request.getResponse().setHeader('content-type',
+        self.request.response.setHeader('content-type',
                                              'application/x-gettext')
         filter = getAdapter(self.context, IMessageExportFilter)
         return filter.exportMessages(domains, languages)
@@ -40,6 +40,6 @@
     def importMessages(self, domains, languages, file):
         filter = getAdapter(self.context, IMessageImportFilter)
         filter.importMessages(domains, languages, file)
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
 
     


=== Zope3/lib/python/Zope/I18n/Views/Browser/Synchronize.py 1.1 => 1.2 ===
         self.sync_domains = self.request.form.get('sync_domains', [])
         self.sync_languages = self.request.form.get('sync_languages', [])
-        self.request.getResponse().setCookie('sync_domains',
+        self.request.response.setCookie('sync_domains',
                                              ','.join(self.sync_domains))
-        self.request.getResponse().setCookie('sync_languages',
+        self.request.response.setCookie('sync_languages',
                                              ','.join(self.sync_languages))
-        self.request.getResponse().setCookie('sync_url',
+        self.request.response.setCookie('sync_url',
                             urllib.quote(self.request['sync_url']).strip())
-        self.request.getResponse().setCookie('sync_username',
+        self.request.response.setCookie('sync_username',
                                              self.request['sync_username'])
-        self.request.getResponse().setCookie('sync_password',
+        self.request.response.setCookie('sync_password',
                                              self.request['sync_password'])
 
-        return self.request.getResponse().redirect(self.request.URL[-1]+
+        return self.request.response.redirect(self.request.URL[-1]+
                                                    '/@@synchronizeForm.html')
 
         
     def synchronize(self):
         mapping = self.queryMessages()
         self.context.synchronize(mapping)
-        return self.request.getResponse().redirect(self.request.URL[-1]+
+        return self.request.response.redirect(self.request.URL[-1]+
                                                    '/@@synchronizeForm.html')
 
 
@@ -192,7 +192,7 @@
                 new_mapping[item[0]] = item[1]
 
         self.context.synchronize(new_mapping)
-        return self.request.getResponse().redirect(self.request.URL[-1]+
+        return self.request.response.redirect(self.request.URL[-1]+
                                                    '/@@synchronizeForm.html')
 
 


=== Zope3/lib/python/Zope/I18n/Views/Browser/Translate.py 1.3 => 1.4 ===
                                              target_language=language):
                 self.context.updateMessage(domain, msg_id, msg, language)
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
         
 
     def editMessages(self):
@@ -92,7 +92,7 @@
                                                  target_language=language):
                     self.context.updateMessage(domain, msg_id, msg, language)
                 
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def deleteMessages(self, message_ids):
@@ -106,52 +106,52 @@
                     self.context.deleteMessage(domain, msgid, language)
                 except KeyError:
                     pass
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def addLanguage(self, language):
         """ """
         self.context.addLanguage(language)
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def addDomain(self, domain):
         """ """
         self.context.addDomain(domain)
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def changeEditLanguages(self, languages=[]):
         """ """
-        self.request.getResponse().setCookie('edit_languages',
+        self.request.response.setCookie('edit_languages',
                                              ','.join(languages))
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def changeEditDomains(self, domains=[]):
         """ """
-        self.request.getResponse().setCookie('edit_domains', ','.join(domains))
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        self.request.response.setCookie('edit_domains', ','.join(domains))
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def changeFilter(self):
         """ """
         filter = self.request.get('filter', '%')
-        self.request.getResponse().setCookie('filter', filter)
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        self.request.response.setCookie('filter', filter)
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def deleteLanguages(self, languages):
         """ """
         for language in languages:
             self.context.deleteLanguage(language)
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])
 
 
     def deleteDomains(self, domains):
         """ """
         for domain in domains:
             self.context.deleteDomain(domain)
-        return self.request.getResponse().redirect(self.request.URL[-1])
+        return self.request.response.redirect(self.request.URL[-1])