learning-credentials 0.3.1rc1__py3-none-any.whl → 0.3.1rc2__py3-none-any.whl
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.
- learning_credentials/generators.py +4 -1
- {learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/METADATA +2 -1
- {learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/RECORD +7 -7
- {learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/WHEEL +0 -0
- {learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/entry_points.txt +0 -0
- {learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/licenses/LICENSE.txt +0 -0
- {learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/top_level.txt +0 -0
|
@@ -46,7 +46,7 @@ def _get_user_name(user: User) -> str:
|
|
|
46
46
|
return user.profile.name or f"{user.first_name} {user.last_name}"
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
def _register_font(font_name:
|
|
49
|
+
def _register_font(font_name: str) -> str | None:
|
|
50
50
|
"""
|
|
51
51
|
Register a custom font if specified in options. If not specified, use the default font (Helvetica).
|
|
52
52
|
|
|
@@ -134,6 +134,7 @@ def _write_text_on_template(template: PageObject, username: str, context_name: s
|
|
|
134
134
|
pdf_canvas.setFillColorRGB(*hex_to_rgb(issue_date_color))
|
|
135
135
|
|
|
136
136
|
issue_date_x = (template_width - pdf_canvas.stringWidth(issue_date)) / 2
|
|
137
|
+
issue_date_x += options.get('issue_date_x', 0)
|
|
137
138
|
issue_date_y = options.get('issue_date_y', 120)
|
|
138
139
|
|
|
139
140
|
issue_date_char_space = options.get(
|
|
@@ -215,6 +216,8 @@ def generate_pdf_credential(
|
|
|
215
216
|
- context_name_color: The color of the context name on the credential (hexadecimal color code).
|
|
216
217
|
- context_name_size: The font size of the context name on the credential. The default value is 28.
|
|
217
218
|
- context_name_font: The font of the context name on the credential. It overrides the `font` option.
|
|
219
|
+
- issue_date_x: The horizontal offset for the issue date from its centered position
|
|
220
|
+
(positive values move right, negative values move left; default is 0).
|
|
218
221
|
- issue_date_y: The Y coordinate of the issue date on the credential (vertical position on the template).
|
|
219
222
|
- issue_date_color: The color of the issue date on the credential (hexadecimal color code).
|
|
220
223
|
- issue_date_size: The font size of the issue date on the credential. The default value is 12.
|
{learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: learning-credentials
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1rc2
|
|
4
4
|
Summary: A pluggable service for preparing Open edX credentials.
|
|
5
5
|
Author-email: OpenCraft <help@opencraft.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -187,6 +187,7 @@ Added
|
|
|
187
187
|
* Support for \n in learning context names in PDF certificates.
|
|
188
188
|
* Options for uppercase name and issue date in PDF certificates.
|
|
189
189
|
* Option for defining character spacing for issue date in PDF certificates.
|
|
190
|
+
* Option for defining the horizontal offset of the issue date from its centered position (``issue_date_x``).
|
|
190
191
|
|
|
191
192
|
Modified
|
|
192
193
|
========
|
|
@@ -3,7 +3,7 @@ learning_credentials/admin.py,sha256=ynK3tVJwLsIeV7Jk66t1FAVyVsU1G-KRIAdRkycVTmA
|
|
|
3
3
|
learning_credentials/apps.py,sha256=trdQxe-JRhUdUaOQoQWiGL1sn6I1sfDiTvdCwy8yGuw,1037
|
|
4
4
|
learning_credentials/compat.py,sha256=bTAB6bTh99ZyhUqOsDtM_BuIPzFxCjySFtfvc-_fCd4,4731
|
|
5
5
|
learning_credentials/exceptions.py,sha256=UaqBVXFMWR2Iob7_LMb3j4NNVmWQFAgLi_MNMRUvGsI,290
|
|
6
|
-
learning_credentials/generators.py,sha256=
|
|
6
|
+
learning_credentials/generators.py,sha256=Ya0TbBD0-T0AWmp6VMQTtBmtgi2obs78vYX38SUmQX8,11696
|
|
7
7
|
learning_credentials/models.py,sha256=J_SCNiu42yhdi12eDMLsxNCTkJK7_vqneQjyGYG5KJ4,16048
|
|
8
8
|
learning_credentials/processors.py,sha256=LkdjmkLBnXc9qeMcksB1T8AQ5ZhYaECyQO__KfHB_aU,15212
|
|
9
9
|
learning_credentials/tasks.py,sha256=byoFEUvN_ayVaU5K5SlEiA7vu9BRPaSSmKnB9g5toec,1927
|
|
@@ -31,9 +31,9 @@ learning_credentials/templates/learning_credentials/edx_ace/certificate_generate
|
|
|
31
31
|
learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/from_name.txt,sha256=-n8tjPSwfwAfeOSZ1WhcCTrpOah4VswzMZ5mh63Pxow,20
|
|
32
32
|
learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/head.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/subject.txt,sha256=S7Hc5T_sZSsSBXm5_H5HBNNv16Ohl0oZn0nVqqeWL0g,132
|
|
34
|
-
learning_credentials-0.3.
|
|
35
|
-
learning_credentials-0.3.
|
|
36
|
-
learning_credentials-0.3.
|
|
37
|
-
learning_credentials-0.3.
|
|
38
|
-
learning_credentials-0.3.
|
|
39
|
-
learning_credentials-0.3.
|
|
34
|
+
learning_credentials-0.3.1rc2.dist-info/licenses/LICENSE.txt,sha256=GDpsPnW_1NKhPvZpZL9imz25P2nIpbwJPEhrlq4vPAU,34523
|
|
35
|
+
learning_credentials-0.3.1rc2.dist-info/METADATA,sha256=fHxCRRyDHCO3lP4GOMR4qW4zBcrPPuATFjPJQ0iESmU,7756
|
|
36
|
+
learning_credentials-0.3.1rc2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
learning_credentials-0.3.1rc2.dist-info/entry_points.txt,sha256=hHqqLUEdzAN24v5OGBX9Fr-wh3ATDPjQjByKz03eC2Y,91
|
|
38
|
+
learning_credentials-0.3.1rc2.dist-info/top_level.txt,sha256=Ce-4_leZe_nny7CpmkeRiemcDV6jIHpIvLjlcQBuf18,21
|
|
39
|
+
learning_credentials-0.3.1rc2.dist-info/RECORD,,
|
|
File without changes
|
{learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{learning_credentials-0.3.1rc1.dist-info → learning_credentials-0.3.1rc2.dist-info}/top_level.txt
RENAMED
|
File without changes
|