mod: ядро (06) пасхалка через ID
This commit is contained in:
@@ -13,7 +13,7 @@ def encode_to_base36(num: int) -> str:
|
||||
if num < 0:
|
||||
raise ValueError("Число должно быть неотрицательным")
|
||||
|
||||
charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
charset = "HYPN0xyzabcdefghijklmnopqrstuvwABCDEFGIJKLMOQRSTUVWXZ123456789"
|
||||
if num < len(charset):
|
||||
return charset[num]
|
||||
|
||||
@@ -271,18 +271,14 @@ def generate_halftone_svg(
|
||||
|
||||
svg_template = (
|
||||
f'<!-- Generated by hypn0.xyz -->\n'
|
||||
f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {width} {height}" data-generated-by="https://hypn0.xyz">'
|
||||
f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {width} {height}" '
|
||||
f'data-author="hypn0.xyz" data-generator="https://hypn0.xyz">'
|
||||
f'{svg_css}'
|
||||
f'<desc>Generated by Hypn0 (https://hypn0.xyz)</desc>'
|
||||
f'{defs_html}'
|
||||
f'<g id="hypn0-canvas">{groups_html}</g>'
|
||||
f'<g id="hypn0-xyz" data-source="https://hypn0.xyz">{groups_html}</g>'
|
||||
f'</svg>'
|
||||
)
|
||||
# f'<!-- Generated by hypn0.xyz -->\n'
|
||||
# f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {width} {height}">'
|
||||
# f'{svg_css}'
|
||||
# f'{defs_html}'
|
||||
# f'<g id="hypn0.xyz" data-generated-by="hypn0.xyz">{groups_html}</g>'
|
||||
# f'</svg>'
|
||||
|
||||
return svg_template
|
||||
|
||||
|
||||
@@ -71,7 +71,8 @@ class HalftoneServiceTests(BaseMediaTestCase):
|
||||
self.assertIn("</svg>", svg)
|
||||
self.assertIn("<defs>", svg)
|
||||
self.assertIn('<circle id="s', svg)
|
||||
self.assertIn('<g id="hypn0-canvas">', svg)
|
||||
self.assertIn('<g id="hypn0-xyz"', svg)
|
||||
self.assertIn("<desc>Generated by Hypn0", svg)
|
||||
|
||||
def test_generate_shapes(self):
|
||||
shapes = ["circle", "ring", "square", "diamond", "triangle", "hexagon", "star", "cross", "line", "wave", "heart"]
|
||||
|
||||
Reference in New Issue
Block a user