Version 0.1.0 0.1.0
authorThierry Florac <thierry.florac@onf.fr>
Wed, 17 Jun 2015 09:56:04 +0200
changeset 12 3db593855266
parent 11 ee5900572943
child 13 c5e656ef5fe6
Version 0.1.0
.installed.cfg
src/pyams_file.egg-info/SOURCES.txt
src/pyams_file.egg-info/requires.txt
src/pyams_file/widget/__init__.py
src/pyams_file/widget/templates/file-input.pt
src/pyams_file/widget/templates/image-input.pt
--- a/.installed.cfg	Wed May 20 12:23:10 2015 +0200
+++ b/.installed.cfg	Wed Jun 17 09:56:04 2015 +0200
@@ -1,31 +1,55 @@
 [buildout]
-installed_develop_eggs = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs/pyams-file.egg-link
-parts = i18n pyflakes test package
+installed_develop_eggs = 
+parts = package i18n pyflakes test
+
+[package]
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pserve
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pviews
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/ptweens
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pcreate
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/prequest
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pshell
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pdistreport
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/proutes
+__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zc.buildout-2.3.1-py3.4.egg
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
+_e = /var/local/env/pyams/eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
+eggs = pyams_file
+	pyramid
+	python-magic
+	zope.component
+	zope.copy
+	zope.interface
+eggs-directory = /var/local/env/pyams/eggs
+recipe = zc.recipe.egg
 
 [i18n]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_file/bin/pybabel
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/polint
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/pot-create
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pybabel
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/polint
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pot-create
 __buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zc.buildout-2.3.1-py3.4.egg
-_b = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
 _e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
 eggs = babel
 	lingua
 eggs-directory = /var/local/env/pyams/eggs
 recipe = zc.recipe.egg
 
 [pyflakes]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_file/bin/pyflakes
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/pyflakes
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pyflakes
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/pyflakes
 __buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zc.buildout-2.3.1-py3.4.egg
-_b = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
 _e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
 eggs = pyflakes
 eggs-directory = /var/local/env/pyams/eggs
 entry-points = pyflakes=pyflakes.scripts.pyflakes:main
@@ -34,48 +58,16 @@
 scripts = pyflakes
 
 [test]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_file/parts/test
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/test
-__buildout_signature__ = zc.recipe.testrunner-2.0.0-py3.4.egg zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zope.testrunner-4.4.6-py3.4.egg zc.buildout-2.3.1-py3.4.egg zope.interface-4.1.2-py3.4-linux-x86_64.egg zope.exceptions-4.0.7-py3.4.egg six-8ad56e9feeb914de21341cbb261cc34e
-_b = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
+__buildout_installed__ = /home/tflorac/Dropbox/src/PyAMS/pyams_file/parts/test
+	/home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/test
+__buildout_signature__ = zc.recipe.testrunner-2.0.0-py3.4.egg zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zope.testrunner-4.4.6-py3.4.egg zc.buildout-2.3.1-py3.4.egg zope.interface-4.1.2-py3.4-linux-x86_64.egg zope.exceptions-4.0.7-py3.4.egg six-e6b62e54b4df360c40dfcbb76c1ecf1a
+_b = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+_d = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
 _e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
+bin-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin
+develop-eggs-directory = /home/tflorac/Dropbox/src/PyAMS/pyams_file/develop-eggs
 eggs = pyams_file [test]
 eggs-directory = /var/local/env/pyams/eggs
-location = /home/borax/Dropbox/src/PyAMS/pyams_file/parts/test
+location = /home/tflorac/Dropbox/src/PyAMS/pyams_file/parts/test
 recipe = zc.recipe.testrunner
-script = /home/borax/Dropbox/src/PyAMS/pyams_file/bin/test
-
-[package]
-__buildout_installed__ = /home/borax/Dropbox/src/PyAMS/pyams_file/bin/pcreate
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/proutes
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/pshell
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/pviews
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/ptweens
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/pserve
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/pdistreport
-	/home/borax/Dropbox/src/PyAMS/pyams_file/bin/prequest
-__buildout_signature__ = zc.recipe.egg-2.0.1-py3.4.egg setuptools-12.0.5-py3.4.egg zc.buildout-2.3.1-py3.4.egg
-_b = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-_d = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
-_e = /var/local/env/pyams/eggs
-bin-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/bin
-develop-eggs-directory = /home/borax/Dropbox/src/PyAMS/pyams_file/develop-eggs
-eggs = pyams_file
-	pyramid
-	python-magic
-	zope.component
-	zope.interface
-eggs-directory = /var/local/env/pyams/eggs
-recipe = zc.recipe.egg
-
-[buildout]
-parts = pyflakes test package i18n
-
-[buildout]
-parts = test package i18n pyflakes
-
-[buildout]
-parts = package i18n pyflakes test
+script = /home/tflorac/Dropbox/src/PyAMS/pyams_file/bin/test
--- a/src/pyams_file.egg-info/SOURCES.txt	Wed May 20 12:23:10 2015 +0200
+++ b/src/pyams_file.egg-info/SOURCES.txt	Wed Jun 17 09:56:04 2015 +0200
@@ -34,13 +34,11 @@
 src/pyams_file/views/__init__.py
 src/pyams_file/views/file.py
 src/pyams_file/widget/__init__.py
-src/pyams_file/widget/configure.zcml
 src/pyams_file/widget/templates/file-display.pt
 src/pyams_file/widget/templates/file-input.pt
 src/pyams_file/widget/templates/image-display.pt
 src/pyams_file/widget/templates/image-input.pt
 src/pyams_file/zmi/__init__.py
-src/pyams_file/zmi/configure.zcml
 src/pyams_file/zmi/file.py
 src/pyams_file/zmi/image.py
 src/pyams_file/zmi/templates/image-crop.pt
--- a/src/pyams_file.egg-info/requires.txt	Wed May 20 12:23:10 2015 +0200
+++ b/src/pyams_file.egg-info/requires.txt	Wed Jun 17 09:56:04 2015 +0200
@@ -3,6 +3,7 @@
 pyramid
 python-magic
 zope.component
+zope.copy
 zope.interface
 
 [test]
--- a/src/pyams_file/widget/__init__.py	Wed May 20 12:23:10 2015 +0200
+++ b/src/pyams_file/widget/__init__.py	Wed Jun 17 09:56:04 2015 +0200
@@ -44,10 +44,12 @@
         deleted = self.widget.request.params.get(deleted_field_name)
         if deleted:
             return DELETED_FILE
-        if value is None or value == '':
+        if (value is None) or (value is NOT_CHANGED) or (value == ''):
             return NOT_CHANGED
         elif isinstance(value, FieldStorage):
             return value.filename, value.file
+        elif isinstance(value, tuple):
+            return value
         else:
             return toBytes(value)
 
--- a/src/pyams_file/widget/templates/file-input.pt	Wed May 20 12:23:10 2015 +0200
+++ b/src/pyams_file/widget/templates/file-input.pt	Wed Jun 17 09:56:04 2015 +0200
@@ -25,7 +25,7 @@
 			&nbsp;&ndash;&nbsp;
 			<i18n:var i18n:translate=""><span i18n:name="size" tal:content="python:round(value.get_size() / 1024)"></span> Kb</i18n:var>
 			<br />
-			<div class="btn-group"
+			<div class="btn-group dropup"
 				 tal:define="actions extension:context_actions(value)"
 				 tal:omit-tag="not:actions">
 				<a class="btn btn-xs btn-default" target="download_window"
@@ -34,9 +34,9 @@
 				</a>
 				<tal:if condition="actions">
 					<button class="btn btn-xs btn-primary dropdown-toggle" data-toggle="dropdown">
-						<i class="fa fa-caret-down"></i>
+						<i class="fa fa-caret-up"></i>
 					</button>
-					<ul class="dropdown-menu pull-right">
+					<ul class="dropdown-menu">
 						<tal:loop repeat="viewlet actions/viewlets"
 								  content="structure viewlet/render" />
 					</ul>
--- a/src/pyams_file/widget/templates/image-input.pt	Wed May 20 12:23:10 2015 +0200
+++ b/src/pyams_file/widget/templates/image-input.pt	Wed Jun 17 09:56:04 2015 +0200
@@ -38,7 +38,7 @@
 			&nbsp;&ndash;&nbsp;
 			<i18n:var i18n:translate=""><span i18n:name="size" tal:content="python:round(value.get_size() / 1024)"></span> Kb</i18n:var>
 			<br />
-			<div class="btn-group"
+			<div class="btn-group dropup"
 				 tal:define="actions extension:context_actions(value)"
 				 tal:omit-tag="not:actions">
 				<a class="btn btn-xs btn-default" target="download_window"
@@ -47,9 +47,9 @@
 				</a>
 				<tal:if condition="actions">
 					<button class="btn btn-xs btn-primary dropdown-toggle" data-toggle="dropdown">
-						<i class="fa fa-caret-down"></i>
+						<i class="fa fa-caret-up"></i>
 					</button>
-					<ul class="dropdown-menu pull-right">
+					<ul class="dropdown-menu">
 						<tal:loop repeat="viewlet actions/viewlets"
 								  content="structure viewlet/render" />
 					</ul>