papyru 2.11.1.dev133__tar.gz → 2.11.1.dev139__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.dev133/papyru.egg-info → papyru-2.11.1.dev139}/PKG-INFO +1 -1
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/xml.py +30 -27
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139/papyru.egg-info}/PKG-INFO +1 -1
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/setup.py +1 -1
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/LICENSE.txt +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/README.md +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/bin/generate_jsonschema.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/__init__.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/auth.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/context.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/__init__.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/component.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/constants.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/__init__.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/ean.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/manufacturer_address.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/motive.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/render_text.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/title.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/resi.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/logger.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/logger_stdout.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/logger_types.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/middleware.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/problem.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/profiler.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/resource.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/serializer.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/stack_context.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/static/__init__.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/static/apps.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/static/urls.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/static/views.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/utils.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/validation.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/__init__.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/assets/Job.json +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/assets/JobStatusHistory.json +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/command/__init__.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/command/config.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/command/types.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/serializers.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/varspool/types.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru/xml_helper.py +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru.egg-info/SOURCES.txt +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru.egg-info/dependency_links.txt +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru.egg-info/requires.txt +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/papyru.egg-info/top_level.txt +0 -0
- {papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/setup.cfg +0 -0
|
@@ -11,16 +11,13 @@ class PlaceholderInfo:
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
@dataclass(frozen=True)
|
|
14
|
-
class
|
|
14
|
+
class CustomPlacement:
|
|
15
15
|
container_width: float
|
|
16
16
|
container_height: float
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
scale_x: float
|
|
22
|
-
scale_y: float
|
|
23
|
-
rotation: float
|
|
17
|
+
scaled_img_width: float
|
|
18
|
+
scaled_img_height: float
|
|
19
|
+
x_offset: float
|
|
20
|
+
y_offset: float
|
|
24
21
|
|
|
25
22
|
|
|
26
23
|
@dataclass(frozen=True)
|
|
@@ -28,7 +25,7 @@ class ImageInfo:
|
|
|
28
25
|
location: str
|
|
29
26
|
width: int
|
|
30
27
|
height: int
|
|
31
|
-
placement:
|
|
28
|
+
placement: CustomPlacement = None
|
|
32
29
|
|
|
33
30
|
|
|
34
31
|
def find_placeholder(doc: XMLHelper,
|
|
@@ -147,31 +144,37 @@ def _place_custom_image(doc: XMLHelper, ph: PlaceholderInfo,
|
|
|
147
144
|
image_info: ImageInfo):
|
|
148
145
|
placement = image_info.placement
|
|
149
146
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
scale_x = placement.scaled_img_width / image_info.width
|
|
148
|
+
scale_y = placement.scaled_img_height / image_info.height
|
|
149
|
+
|
|
150
|
+
crop = {
|
|
151
|
+
'x': -placement.x_offset / scale_x,
|
|
152
|
+
'y': -placement.y_offset / scale_y,
|
|
153
|
+
'width': placement.container_width / scale_x,
|
|
154
|
+
'height': placement.container_height / scale_y,
|
|
155
|
+
}
|
|
153
156
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
y = placement.placement_y - placement.container_y
|
|
157
|
+
doc.set_attribute(ph.wrapper, 'viewBox',
|
|
158
|
+
'%s %s %s %s' % (crop['x'], crop['y'],
|
|
159
|
+
crop['width'], crop['height']))
|
|
158
160
|
|
|
159
161
|
has_xlink = doc.namespace('xlink') is not None
|
|
160
162
|
doc.set_attribute(ph.placeholder,
|
|
161
163
|
'href', image_info.location,
|
|
162
164
|
'xlink' if has_xlink else None)
|
|
163
165
|
|
|
164
|
-
doc.set_attribute(ph.placeholder, 'x', '
|
|
165
|
-
doc.set_attribute(ph.placeholder, 'y', '
|
|
166
|
-
doc.set_attribute(ph.placeholder, 'width', '%s' %
|
|
167
|
-
doc.set_attribute(ph.placeholder, 'height', '%s' %
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
166
|
+
doc.set_attribute(ph.placeholder, 'x', '0.0')
|
|
167
|
+
doc.set_attribute(ph.placeholder, 'y', '0.0')
|
|
168
|
+
doc.set_attribute(ph.placeholder, 'width', '%s' % image_info.width)
|
|
169
|
+
doc.set_attribute(ph.placeholder, 'height', '%s' % image_info.height)
|
|
170
|
+
|
|
171
|
+
doc.set_attribute(ph.placeholder, 'bbox',
|
|
172
|
+
'{"x": %s, "y": %s, "width": %s, "height": %s}'
|
|
173
|
+
% (crop['x'], crop['y'],
|
|
174
|
+
crop['width'], crop['height']), 'pap')
|
|
175
|
+
doc.set_attribute(ph.placeholder, 'img-dimensions',
|
|
176
|
+
'{"width": %s, "height": %s}'
|
|
177
|
+
% (image_info.width, image_info.height), 'pap')
|
|
175
178
|
|
|
176
179
|
_set_changed(doc, ph.placeholder)
|
|
177
180
|
|
|
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.dev133 → papyru-2.11.1.dev139}/papyru/create_variant/edit_template/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{papyru-2.11.1.dev133 → papyru-2.11.1.dev139}/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
|