r252642 - collective.zipfiletransport/trunk/collective/zipfiletransport/browser
"Encolpe Degoute" <svn-changes-z4DKO/[email protected]> Mon, 14 Oct 2013 11:38:39 +0000 (UTC)
| Newsgroups | gmane.comp.web.zope.plone.collective.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: encolpe
Date: Mon Oct 14 11:38:39 2013
New Revision: 252642
Modified:
collective.zipfiletransport/trunk/collective/zipfiletransport/browser/zipexport.py
Log:
remove stgring module dependdency
Modified: collective.zipfiletransport/trunk/collective/zipfiletransport/browser/zipexport.py
==============================================================================
--- collective.zipfiletransport/trunk/collective/zipfiletransport/browser/zipexport.py (original)
+++ collective.zipfiletransport/trunk/collective/zipfiletransport/browser/zipexport.py Mon Oct 14 11:38:39 2013
@@ -31,7 +31,6 @@
from collective.zipfiletransport.browser.common import BaseForm
from widgets import ExportWidget
import os
-import string
from collective.zipfiletransport import ZipFileTransportMessageFactory as _
class ExportFormAdapter(object):
@@ -71,11 +70,12 @@
name="zipfiletransport")
+
@action(_(u'Export'))
def action_export(self, action, data):
logger = logging.getLogger('zipfiletransport.export')
RESPONSE_BLOCK_SIZE = 32768
- #Discover Object Paths in hidden form fields
+ logger.info("Discover Object Paths in hidden form fields")
obj_paths = None
try:
self.context.REQUEST['form.obj_paths']
@@ -86,9 +86,10 @@
obj_paths += [x]
except:
pass
+
filename = self.context.REQUEST['form.filename']
- if string.find(filename,'.zip') == -1:
+ if filename.find('.zip') == -1:
filename += ".zip"
if self.context.portal_membership.isAnonymousUser() != 0:
@@ -127,9 +128,5 @@
try:
os.unlink(zip_path)
except Exception, e:
- logger.warning(
- 'Cannot remove %s: %s' %(
- zip_path, e
- )
- )
+ logger.warning('Cannot remove %s: %s' %(zip_path, e))
return
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk