papyru 2.11.1.dev139__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.dev139/papyru.egg-info → papyru-2.11.1.dev140}/PKG-INFO +1 -1
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/xml.py +15 -27
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140/papyru.egg-info}/PKG-INFO +1 -1
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/setup.py +1 -1
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/LICENSE.txt +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/README.md +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/bin/generate_jsonschema.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/__init__.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/auth.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/context.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/__init__.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/component.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/constants.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/__init__.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/ean.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/manufacturer_address.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/motive.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/render_text.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/edit_template/title.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/create_variant/resi.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/logger.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/logger_stdout.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/logger_types.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/middleware.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/problem.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/profiler.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/resource.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/serializer.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/stack_context.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/static/__init__.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/static/apps.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/static/urls.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/static/views.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/utils.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/validation.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/__init__.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/assets/Job.json +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/assets/JobStatusHistory.json +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/command/__init__.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/command/config.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/command/types.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/serializers.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/varspool/types.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru/xml_helper.py +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru.egg-info/SOURCES.txt +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru.egg-info/dependency_links.txt +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru.egg-info/requires.txt +0 -0
- {papyru-2.11.1.dev139 → papyru-2.11.1.dev140}/papyru.egg-info/top_level.txt +0 -0
- {papyru-2.11.1.dev139 → 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,23 +138,13 @@ 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
|
-
|
|
146
|
-
|
|
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
|
-
}
|
|
141
|
+
def _crop_image(doc: XMLHelper, ph: PlaceholderInfo,
|
|
142
|
+
image_info: ImageInfo) -> XMLHelper:
|
|
143
|
+
crop = image_info.crop
|
|
156
144
|
|
|
157
145
|
doc.set_attribute(ph.wrapper, 'viewBox',
|
|
158
|
-
'%s %s %s %s' % (crop
|
|
159
|
-
crop
|
|
146
|
+
'%s %s %s %s' % (crop.x, crop.y,
|
|
147
|
+
crop.width, crop.height))
|
|
160
148
|
|
|
161
149
|
has_xlink = doc.namespace('xlink') is not None
|
|
162
150
|
doc.set_attribute(ph.placeholder,
|
|
@@ -170,8 +158,8 @@ def _place_custom_image(doc: XMLHelper, ph: PlaceholderInfo,
|
|
|
170
158
|
|
|
171
159
|
doc.set_attribute(ph.placeholder, 'bbox',
|
|
172
160
|
'{"x": %s, "y": %s, "width": %s, "height": %s}'
|
|
173
|
-
% (crop
|
|
174
|
-
crop
|
|
161
|
+
% (crop.x, crop.y,
|
|
162
|
+
crop.width, crop.height), 'pap')
|
|
175
163
|
doc.set_attribute(ph.placeholder, 'img-dimensions',
|
|
176
164
|
'{"width": %s, "height": %s}'
|
|
177
165
|
% (image_info.width, image_info.height), 'pap')
|
|
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.dev139 → 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.dev139 → 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
|