svg2rlg-issue-6.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. commit e42661b9cd6d7b71ce5e7674ac8eff25c74db07a
  2. Author: yac <yac@blesmrt.net>
  3. Date: Wed May 8 05:00:32 2013 +0200
  4. use entry_point fixes #6
  5. diff --git a/setup.py b/setup.py
  6. index 9e00fba..512fa79 100644
  7. --- a/setup.py
  8. +++ b/setup.py
  9. @@ -1,6 +1,6 @@
  10. #!/usr/bin/python
  11. # -*- coding: utf-8 -*-
  12. -from distutils.core import setup
  13. +from setuptools import setup
  14. setup(
  15. name = 'svg2rlg',
  16. @@ -12,6 +12,8 @@ setup(
  17. url = 'http://code.google.com/p/svg2rlg/',
  18. download_url = 'http://pypi.python.org/pypi/svg2rlg/',
  19. requires = ['reportlab'],
  20. + entry_points = {
  21. + 'console_scripts': ['svg2rlg = svg2rlg:main']},
  22. classifiers=[
  23. 'Environment :: Console',
  24. @@ -30,4 +32,4 @@ The authors motivation was to have a more robust handling of
  25. SVG files in the **rst2pdf** tool. Specific to be able to handle
  26. the quirks needed to include SVG export from matplotlib.
  27. '''
  28. -)
  29. \ No newline at end of file
  30. +)
  31. diff --git a/svg2rlg.py b/svg2rlg.py
  32. index 2b35c62..cc812b2 100644
  33. --- a/svg2rlg.py
  34. +++ b/svg2rlg.py
  35. @@ -1562,7 +1562,7 @@ def svg2rlg(filename):
  36. return renderer.render(xml)
  37. -if __name__ == "__main__":
  38. +def main():
  39. import sys
  40. import os