[Checkins] SVN: zopyx.smartprintng.client/trunk/ updated
Andreas Jung
andreas at andreas-jung.com
Sun May 16 04:01:07 EDT 2010
Log message for revision 112341:
updated
Changed:
A zopyx.smartprintng.client/trunk/LICENSE.txt
U zopyx.smartprintng.client/trunk/README.txt
U zopyx.smartprintng.client/trunk/docs/HISTORY.txt
U zopyx.smartprintng.client/trunk/zopyx/smartprintng/client/zip_client.py
-=-
Added: zopyx.smartprintng.client/trunk/LICENSE.txt
===================================================================
--- zopyx.smartprintng.client/trunk/LICENSE.txt (rev 0)
+++ zopyx.smartprintng.client/trunk/LICENSE.txt 2010-05-16 08:01:06 UTC (rev 112341)
@@ -0,0 +1,54 @@
+Zope Public License (ZPL) Version 2.1
+-------------------------------------
+
+A copyright notice accompanies this license document that
+identifies the copyright holders.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the
+ accompanying copyright notice, this list of conditions,
+ and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+3. Names of the copyright holders must not be used to
+ endorse or promote products derived from this software
+ without prior written permission from the copyright
+ holders.
+
+4. The right to distribute this software or to use it for
+ any purpose does not give you the right to use
+ Servicemarks (sm) or Trademarks (tm) of the copyright
+ holders. Use of them is covered by separate agreement
+ with the copyright holders.
+
+5. If any files are modified, you must cause the modified
+ files to carry prominent notices stating that you changed
+ the files and the date of any change.
+
+Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
+ AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGE.
Modified: zopyx.smartprintng.client/trunk/README.txt
===================================================================
--- zopyx.smartprintng.client/trunk/README.txt 2010-05-15 17:18:15 UTC (rev 112340)
+++ zopyx.smartprintng.client/trunk/README.txt 2010-05-16 08:01:06 UTC (rev 112341)
@@ -1,13 +1,19 @@
zopyx.smartprintng.client
=========================
-The SmartPrintNG server client-side implementation
+The zip-client-side implementation of the Produce & Publish server
+(aka ``zopyx.smartprintng.server``´).
+License
+=======
+This package is licensed under the Zope Public License V 2.1 (ZPL).
+
+
Contact
=======
-| ZOPYX Ltd. & Co. KG
+| ZOPYX Limited
| c/o Andreas Jung,
| Charlottenstr. 37/1
| D-72070 Tuebingen, Germany
Modified: zopyx.smartprintng.client/trunk/docs/HISTORY.txt
===================================================================
--- zopyx.smartprintng.client/trunk/docs/HISTORY.txt 2010-05-15 17:18:15 UTC (rev 112340)
+++ zopyx.smartprintng.client/trunk/docs/HISTORY.txt 2010-05-16 08:01:06 UTC (rev 112341)
@@ -1,6 +1,11 @@
Changelog
=========
+0.6.0 (2010-05-16)
+------------------
+- deprecated convertZIP() api method
+- added convertZIP2() api method
+
0.5.4 (2010-03-28)
------------------
* better output directory handling
Modified: zopyx.smartprintng.client/trunk/zopyx/smartprintng/client/zip_client.py
===================================================================
--- zopyx.smartprintng.client/trunk/zopyx/smartprintng/client/zip_client.py 2010-05-15 17:18:15 UTC (rev 112340)
+++ zopyx.smartprintng.client/trunk/zopyx/smartprintng/client/zip_client.py 2010-05-16 08:01:06 UTC (rev 112341)
@@ -13,6 +13,7 @@
import zipfile
import tempfile
import zipfile
+import warnings
class Proxy(object):
@@ -58,6 +59,12 @@
return server()
def convertZIP(self, dirname, converter_name='pdf-prince'):
+ """ XMLRPC client to SmartPrintNG server (deprecated)"""
+
+ warnings.warn("convertZIP() is deprecated", DeprecationWarning)
+ return self.convertZIP2(dirname, converter_name)['output_filename']
+
+ def convertZIP2(self, dirname, converter_name='pdf-prince'):
""" XMLRPC client to SmartPrintNG server """
auth_token = self._authenticate()
@@ -72,14 +79,20 @@
# (it will contain only *one* file)
zip_temp = tempfile.mktemp()
file(zip_temp, 'wb').write(base64.decodestring(zip_data))
+
+ result = dict()
ZF = zipfile.ZipFile(zip_temp, 'r')
- names = ZF.namelist()
- output_filename = os.path.join(self.output_directory, os.path.basename(names[0]))
- file(output_filename, 'wb').write(ZF.read(names[0]))
+ for name in ZF.namelist():
+ fullname = os.path.join(self.output_directory, os.path.basename(name))
+ file(fullname, 'wb').write(ZF.read(name))
+ if name.startswith('output.'):
+ result['output_filename'] = fullname
+ elif name.startswith('conversion-output'):
+ result['conversion_output'] = fullname
ZF.close()
os.unlink(zip_filename)
os.unlink(zip_temp)
- return output_filename
+ return result
def convertZIPandRedirect(self, dirname, converter_name='pdf-prince', prefix=None):
""" XMLRPC client to SmartPrintNG server """
@@ -117,10 +130,11 @@
if __name__ == '__main__':
# usage: convertZIP <dirname>
- proxy = Proxy(host='zopyx.com', port=6543)
+ proxy = Proxy(host='localhost', port=6543)
print proxy.ping()
print proxy.availableConverters()
print proxy.convertZIP(sys.argv[1])
+ print proxy.convertZIP2(sys.argv[1])
# print proxy.convertZIPEmail(sys.argv[1],
# sender='foo at bar.org',
# recipients='foo at bar.org',
More information about the checkins
mailing list