commit e42661b9cd6d7b71ce5e7674ac8eff25c74db07a Author: yac Date: Wed May 8 05:00:32 2013 +0200 use entry_point fixes #6 diff --git a/setup.py b/setup.py index 9e00fba..512fa79 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from distutils.core import setup +from setuptools import setup setup( name = 'svg2rlg', @@ -12,6 +12,8 @@ setup( url = 'http://code.google.com/p/svg2rlg/', download_url = 'http://pypi.python.org/pypi/svg2rlg/', requires = ['reportlab'], + entry_points = { + 'console_scripts': ['svg2rlg = svg2rlg:main']}, classifiers=[ 'Environment :: Console', @@ -30,4 +32,4 @@ The authors motivation was to have a more robust handling of SVG files in the **rst2pdf** tool. Specific to be able to handle the quirks needed to include SVG export from matplotlib. ''' -) \ No newline at end of file +) diff --git a/svg2rlg.py b/svg2rlg.py index 2b35c62..cc812b2 100644 --- a/svg2rlg.py +++ b/svg2rlg.py @@ -1562,7 +1562,7 @@ def svg2rlg(filename): return renderer.render(xml) -if __name__ == "__main__": +def main(): import sys import os