File: add_main_function.diff

package info (click to toggle)
python-trml2pdf 1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 508 kB
  • ctags: 116
  • sloc: python: 565; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 669 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Add main function
 This is needed so that we can call the program from a
 wrapper.
Author: Raphael Hertzog <hertzog@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()