papyru 2.11.1.dev134__tar.gz → 2.11.1.dev140__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {papyru-2.11.1.dev134/papyru.egg-info → papyru-2.11.1.dev140}/PKG-INFO +1 -1
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/xml.py +25 -21
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140/papyru.egg-info}/PKG-INFO +1 -1
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/setup.py +1 -1
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/LICENSE.txt +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/README.md +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/bin/generate_jsonschema.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/__init__.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/auth.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/context.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/__init__.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/component.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/constants.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/__init__.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/ean.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/manufacturer_address.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/motive.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/render_text.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/title.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/resi.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/logger.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/logger_stdout.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/logger_types.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/middleware.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/problem.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/profiler.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/resource.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/serializer.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/stack_context.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/static/__init__.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/static/apps.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/static/urls.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/static/views.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/utils.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/validation.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/__init__.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/assets/Job.json +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/assets/JobStatusHistory.json +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/command/__init__.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/command/config.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/command/types.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/serializers.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/varspool/types.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/xml_helper.py +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru.egg-info/SOURCES.txt +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru.egg-info/dependency_links.txt +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru.egg-info/requires.txt +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru.egg-info/top_level.txt +0 -0
- {papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/setup.cfg +0 -0
|
@@ -11,13 +11,11 @@ class PlaceholderInfo:
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
@dataclass(frozen=True)
|
|
14
|
-
class
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
x_offset: float
|
|
20
|
-
y_offset: float
|
|
14
|
+
class ImageCrop:
|
|
15
|
+
x: float
|
|
16
|
+
y: float
|
|
17
|
+
width: float
|
|
18
|
+
height: float
|
|
21
19
|
|
|
22
20
|
|
|
23
21
|
@dataclass(frozen=True)
|
|
@@ -25,7 +23,7 @@ class ImageInfo:
|
|
|
25
23
|
location: str
|
|
26
24
|
width: int
|
|
27
25
|
height: int
|
|
28
|
-
|
|
26
|
+
crop: ImageCrop = None
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
def find_placeholder(doc: XMLHelper,
|
|
@@ -88,8 +86,8 @@ def fit_image(doc: XMLHelper,
|
|
|
88
86
|
if ph is None:
|
|
89
87
|
return doc
|
|
90
88
|
|
|
91
|
-
if image_info.
|
|
92
|
-
return
|
|
89
|
+
if image_info.crop is not None:
|
|
90
|
+
return _crop_image(doc, ph, image_info)
|
|
93
91
|
else:
|
|
94
92
|
wrapper_dims = (float(doc.get_attribute(ph.wrapper, 'width')),
|
|
95
93
|
float(doc.get_attribute(ph.wrapper, 'height')))
|
|
@@ -140,25 +138,31 @@ def _fit_dimensions(container_dims: (float, float),
|
|
|
140
138
|
return ((e_w - w) / 2, 0.0, w, e_h)
|
|
141
139
|
|
|
142
140
|
|
|
143
|
-
def
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
def _crop_image(doc: XMLHelper, ph: PlaceholderInfo,
|
|
142
|
+
image_info: ImageInfo) -> XMLHelper:
|
|
143
|
+
crop = image_info.crop
|
|
146
144
|
|
|
147
145
|
doc.set_attribute(ph.wrapper, 'viewBox',
|
|
148
|
-
'
|
|
149
|
-
|
|
146
|
+
'%s %s %s %s' % (crop.x, crop.y,
|
|
147
|
+
crop.width, crop.height))
|
|
150
148
|
|
|
151
149
|
has_xlink = doc.namespace('xlink') is not None
|
|
152
150
|
doc.set_attribute(ph.placeholder,
|
|
153
151
|
'href', image_info.location,
|
|
154
152
|
'xlink' if has_xlink else None)
|
|
155
153
|
|
|
156
|
-
doc.set_attribute(ph.placeholder, 'x', '
|
|
157
|
-
doc.set_attribute(ph.placeholder, 'y', '
|
|
158
|
-
doc.set_attribute(ph.placeholder, 'width', '%s' %
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
154
|
+
doc.set_attribute(ph.placeholder, 'x', '0.0')
|
|
155
|
+
doc.set_attribute(ph.placeholder, 'y', '0.0')
|
|
156
|
+
doc.set_attribute(ph.placeholder, 'width', '%s' % image_info.width)
|
|
157
|
+
doc.set_attribute(ph.placeholder, 'height', '%s' % image_info.height)
|
|
158
|
+
|
|
159
|
+
doc.set_attribute(ph.placeholder, 'bbox',
|
|
160
|
+
'{"x": %s, "y": %s, "width": %s, "height": %s}'
|
|
161
|
+
% (crop.x, crop.y,
|
|
162
|
+
crop.width, crop.height), 'pap')
|
|
163
|
+
doc.set_attribute(ph.placeholder, 'img-dimensions',
|
|
164
|
+
'{"width": %s, "height": %s}'
|
|
165
|
+
% (image_info.width, image_info.height), 'pap')
|
|
162
166
|
|
|
163
167
|
_set_changed(doc, ph.placeholder)
|
|
164
168
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{papyru-2.11.1.dev134 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/render_text.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|