List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH 1/1] filters: force python 3.x and fix options
@ 2015-10-12 15:34 list
  2015-10-12 16:34 ` Jason
  0 siblings, 1 reply; 3+ messages in thread
From: list @ 2015-10-12 15:34 UTC (permalink / raw)


From: Christian Hesse <mail at eworm.de>

The python markdown module is a little bit picky when it come to
options. So force python 3.x and fix the options. Documentation says
about input:

[...] or None (default) which will read from stdin.

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 filters/html-converters/md2html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html
index 1488f48..8adedbe 100755
--- a/filters/html-converters/md2html
+++ b/filters/html-converters/md2html
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import markdown
 import sys
 print('''
@@ -282,5 +282,5 @@ print('''
 ''')
 print("<div class='markdown-body'>")
 # Note: you may want to run this through bleach for sanitization
-markdown.markdownFromFile(input=sys.stdin, output_format="html5")
+markdown.markdownFromFile(input=None, output_format="html5")
 print("</div>")
-- 
2.6.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] filters: force python 3.x and fix options
  2015-10-12 15:34 [PATCH 1/1] filters: force python 3.x and fix options list
@ 2015-10-12 16:34 ` Jason
  2015-10-12 18:13   ` list
  0 siblings, 1 reply; 3+ messages in thread
From: Jason @ 2015-10-12 16:34 UTC (permalink / raw)


Python 2 works fine. But thanks for that catch with input already
defaulting to stdin. Applied that optimization.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] filters: force python 3.x and fix options
  2015-10-12 16:34 ` Jason
@ 2015-10-12 18:13   ` list
  0 siblings, 0 replies; 3+ messages in thread
From: list @ 2015-10-12 18:13 UTC (permalink / raw)


"Jason A. Donenfeld" <Jason at zx2c4.com> on Mon, 2015/10/12 18:34:
> Python 2 works fine. But thanks for that catch with input already
> defaulting to stdin. Applied that optimization.

The python 3.x part was from a packager's point of view. We have other
scripts that force python 3.x. For systems that have the python binary call
the python 2.x version this may add dependency to both python versions.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20151012/7d1557a0/attachment.asc>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-12 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 15:34 [PATCH 1/1] filters: force python 3.x and fix options list
2015-10-12 16:34 ` Jason
2015-10-12 18:13   ` list

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).