mirror of
https://github.com/nophead/Mendel90.git
synced 2025-08-12 00:04:02 +02:00
add support for python 3.2 and 3.3, retain backward compatibility
This commit is contained in:
15
InkCL.py
15
InkCL.py
@@ -1,13 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
#from http://kaioa.com/node/42
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os, subprocess, sys
|
||||
|
||||
|
||||
def run(*args):
|
||||
print "inkscape",
|
||||
print("inkscape", end=" ")
|
||||
for arg in args:
|
||||
print arg,
|
||||
print
|
||||
print(arg, end=" ")
|
||||
print()
|
||||
run = subprocess.Popen(["inkscape"] + list(args) + [" -z"], shell = False, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
|
||||
out,err=[e.splitlines() for e in run.communicate()]
|
||||
return run.returncode, out, err
|
||||
@@ -15,8 +18,8 @@ def run(*args):
|
||||
if __name__=='__main__':
|
||||
r = run(sys.argv[1:])
|
||||
if not r[0]==0:
|
||||
print 'return code:',r[0]
|
||||
print('return code:', r[0])
|
||||
for l in r[1]:
|
||||
print l
|
||||
print(l)
|
||||
for l in r[2]:
|
||||
print l
|
||||
print(l)
|
||||
|
Reference in New Issue
Block a user