[Python-modules-commits] r8066 - in packages/python-trml2pdf/trunk/debian (4 files)

hertzog at users.alioth.debian.org hertzog at users.alioth.debian.org
Fri Mar 27 13:02:40 UTC 2009


    Date: Friday, March 27, 2009 @ 13:02:40
  Author: hertzog
Revision: 8066

Add new patch add_main_function.diff to create an explicit main() function
so that /usr/bin/trml2pdf can call it directly.

Added:
  packages/python-trml2pdf/trunk/debian/patches/add_main_function.diff
Modified:
  packages/python-trml2pdf/trunk/debian/changelog
  packages/python-trml2pdf/trunk/debian/patches/series
  packages/python-trml2pdf/trunk/debian/trml2pdf

Modified: packages/python-trml2pdf/trunk/debian/changelog
===================================================================
--- packages/python-trml2pdf/trunk/debian/changelog	2009-03-27 12:51:55 UTC (rev 8065)
+++ packages/python-trml2pdf/trunk/debian/changelog	2009-03-27 13:02:40 UTC (rev 8066)
@@ -1,4 +1,4 @@
-python-trml2pdf (1.2-1) UNRELEASED; urgency=low
+python-trml2pdf (1.2-1) unstable; urgency=low
 
   [ Piotr Ożarowski ]
   * Vcs-Browser and Homepage fields added
@@ -28,8 +28,10 @@
   * Rename all debhelper-related debian/* files with the python-trml2dpf
     prefix.
   * Add a description to the add_setup_py.diff patch.
+  * Add new patch add_main_function.diff to create an explicit main() function
+    so that /usr/bin/trml2pdf can call it directly.
 
- -- Raphael Hertzog <hertzog at debian.org>  Fri, 27 Mar 2009 10:15:55 +0100
+ -- Raphael Hertzog <hertzog at debian.org>  Fri, 27 Mar 2009 14:02:19 +0100
 
 python-trml2pdf (1.0-1) unstable; urgency=low
 

Added: packages/python-trml2pdf/trunk/debian/patches/add_main_function.diff
===================================================================
--- packages/python-trml2pdf/trunk/debian/patches/add_main_function.diff	                        (rev 0)
+++ packages/python-trml2pdf/trunk/debian/patches/add_main_function.diff	2009-03-27 13:02:40 UTC (rev 8066)
@@ -0,0 +1,24 @@
+Description: Add main function
+ This is needed so that we can call the program from a
+ wrapper.
+Author: Raphael Hertzog <hertzog at debian.org>
+Forwarded-Upstream: no (no clear upstream)
+
+--- a/trml2pdf/trml2pdf.py
++++ b/trml2pdf/trml2pdf.py
+@@ -549,7 +549,7 @@ def trml2pdf_help():
+ 	print 'Render the standard input (RML) and output a PDF file'
+ 	sys.exit(0)
+ 
+-if __name__=="__main__":
++def main():
+ 	if len(sys.argv)>1:
+ 		if sys.argv[1]=='--help':
+ 			trml2pdf_help()
+@@ -557,3 +557,6 @@ if __name__=="__main__":
+ 	else:
+ 		print 'Usage: trml2pdf input.rml >output.pdf'
+ 		print 'Try \'trml2pdf --help\' for more information.'
++
++if __name__=="__main__":
++    main()

Modified: packages/python-trml2pdf/trunk/debian/patches/series
===================================================================
--- packages/python-trml2pdf/trunk/debian/patches/series	2009-03-27 12:51:55 UTC (rev 8065)
+++ packages/python-trml2pdf/trunk/debian/patches/series	2009-03-27 13:02:40 UTC (rev 8066)
@@ -1 +1,2 @@
 add_setup_py.diff
+add_main_function.diff

Modified: packages/python-trml2pdf/trunk/debian/trml2pdf
===================================================================
--- packages/python-trml2pdf/trunk/debian/trml2pdf	2009-03-27 12:51:55 UTC (rev 8065)
+++ packages/python-trml2pdf/trunk/debian/trml2pdf	2009-03-27 13:02:40 UTC (rev 8066)
@@ -1,2 +1,3 @@
-#!/bin/sh
-exec python -m trml2pdf.trml2pdf "$@"
+#!/usr/bin/python
+from trml2pdf.trml2pdf import main
+main()




More information about the Python-modules-commits mailing list