changeset 0:e466f86a4520 draft default tip

Imported from capsule None
author cmonjeau
date Tue, 07 Jul 2015 08:49:28 -0400
parents
children
files repository_dependencies.xml zip.py zip.xml
diffstat 3 files changed, 75 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/repository_dependencies.xml	Tue Jul 07 08:49:28 2015 -0400
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<repositories description="This tool requires archive datatypes definitions (e.g. zip, tar.gz, etc. format).">
+  <repository changeset_revision="9e4c4b66b4a0" name="archive_datatypes" owner="cmonjeau" toolshed="https://toolshed.g2.bx.psu.edu" />
+</repositories>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zip.py	Tue Jul 07 08:49:28 2015 -0400
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+"""
+Create a zip archive
+
+usage: zip.py [options]
+
+See below for options
+"""
+
+import os, subprocess, sys
+import zipfile
+
+def __main__():
+
+	# init
+	output_zip = sys.argv[1]
+
+	# create the zip archive
+	myarchive = zipfile.ZipFile(output_zip, 'w', allowZip64=True)
+
+	# for all files, write in the archive
+	for i in range(2, len(sys.argv),2):
+		myarchive.write(sys.argv[i], os.path.basename(sys.argv[i+1]))
+
+
+
+
+
+
+if __name__ == "__main__": __main__()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zip.xml	Tue Jul 07 08:49:28 2015 -0400
@@ -0,0 +1,39 @@
+<tool id="zip" name="Zip" version="1.0.1" >
+  <description>and name files</description>
+  <command interpreter="python">
+	zip.py
+	$output
+	#for $num_repeat in $files
+		${num_repeat.file}
+		${num_repeat.file_name}
+	#end for
+  </command>
+ <inputs>
+    <repeat name="files" title="File to zip" min="1">
+      <param name="file_name" type="text" format="txt" label="Zipped file name (without spaces)">
+        <validator type="empty_field" message="Required field" />
+        <validator type="expression" message="Forbidden value (fic.zip)">value != 'fic.zip'</validator>
+        <validator type="regex" message="Missing extension">.+\..+</validator>
+      </param>
+      <param name="file" type="data" label="File" />
+    </repeat>
+ </inputs>
+ <outputs>
+  <data format="zip" name="output" label="zipped files: archive.zip" />
+ </outputs>
+ <help>
+**Tool documentation**
+
+This tool simply creates a zip file aggregating the input files. The name for the files has to be chosen by the user, it can't be empty and has to be with a least one extension.
+
+The output is a zip file.
+
+CHANGELOG : This tool can manage large files
+
+--------
+
+**Integrated by:**
+
+Cyril Monjeaud
+ </help>
+</tool>