Skip to content

Commit

Permalink
Add all required components.
Browse files Browse the repository at this point in the history
  • Loading branch information
inter1965 committed Sep 1, 2022
1 parent 2608976 commit 2580313
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ tests/__pycache__/
tests/data/refs/simple_inkscape_scripting*.out.export
tests/data/refs/svg_to_simp_ink_script*.out.export
/build
/sbdist
/sbdist
/dist
/*.egg-info
37 changes: 37 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[metadata]
name = simpinkscr
url = https://github.com/spakin/SimpInkScr
author = Scott Pakin
author_email = [email protected]
description = Simple Inkscape Scripting.
version = 3.1.1
long_description = file: README.md
long_description_content_type = text/markdown
license = GPL-3.0 license
classifiers =
Development Status :: 3 - Alpha
License :: OSI Approved :: BSD License
Natural Language :: English
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10

project_urls =
Source Code =https://github.com/spakin/SimpInkScr

[options]
zip_safe = False
packages = simpinkscr
python_requires = >=3.7
install_requires =
inkex

[options.entry_points]
console_scripts =
simple_inkscape_scripting = simpinkscr.simple_inkscape_scripting:main
svg_to_simp_ink_script = simpinkscr.svg_to_simp_ink_script:main

[bdist_wheel]
universal = 1

3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import setuptools

setuptools.setup()
3 changes: 2 additions & 1 deletion simpinkscr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from math import *
from random import *
from inkex import Transform
from inkex.paths import Arc, Curve, Horz, Line, Move, Quadratic, Smooth, \
TepidQuadratic, Vert, ZoneClose
from .simple_inkscape_scripting import style, transform, circle, ellipse, \
rect, line, polyline, polygon, regular_polygon, star, arc, path, \
connector, text, image, clone, duplicate, group, layer, hyperlink, \
inkex_object, filter_effect, linear_gradient, radial_gradient, \
clip_path, massk, marker, push_defaults, pop_defaults, path_effect, \
clip_path, mask, marker, push_defaults, pop_defaults, path_effect, \
selected_shapes, all_shapes, guide
6 changes: 5 additions & 1 deletion simpinkscr/simple_inkscape_scripting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2093,12 +2093,16 @@ def effect(self):
code += '\n'
if self.options.program is not None:
code += self.options.program.replace(r'\n', '\n')
#remove unnecessary import
code.replace("from simpinkscr import *", "")
try:
exec(code, sis_globals)
except SystemExit:
pass
_simple_top.replace_all_guides(sis_globals['guides'])

def main():
SimpleInkscapeScripting().run()

if __name__ == '__main__':
SimpleInkscapeScripting().run()
main()
5 changes: 4 additions & 1 deletion simpinkscr/svg_to_simp_ink_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,5 +1116,8 @@ def save(self, stream):
stream.write(ln.encode('utf-8'))


if __name__ == '__main__':
def main():
SvgToPythonScript().run()

if __name__ == '__main__':
main()

0 comments on commit 2580313

Please sign in to comment.