Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bin] newNodeType: update #1630

Merged
merged 1 commit into from
Feb 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bin/meshroom_newNodeType
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import argparse
import os
import re
import sys
import shlex
from pprint import pprint

def trim(s):
Expand Down Expand Up @@ -60,7 +61,7 @@ parser.add_argument('node', metavar='NODE_NAME', type=str,
help='New node name')
parser.add_argument('bin', metavar='CMDLINE', type=str,
default=None,
help='Output plugin folder')
help='Input executable')
parser.add_argument('--output', metavar='DIR', type=str,
default=os.path.dirname(__file__),
help='Output plugin folder')
Expand All @@ -77,7 +78,7 @@ soft = "{nodeType}"
if args.bin:
soft = args.bin
import subprocess
proc = subprocess.Popen(args=[args.bin, '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
proc = subprocess.Popen(args=shlex.split(args.bin) + ['--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
inputCmdLineDoc = stdout if stdout else stderr
elif sys.stdin.isatty():
Expand Down Expand Up @@ -137,7 +138,7 @@ choiceValues1_re = re.compile('\* (?P<value>\w+):')
choiceValues2_re = re.compile('\((?P<value>.+?)\)')
choiceValues3_re = re.compile('\{(?P<value>.+?)\}')

cmdLineArgs = args_re.findall(inputCmdLineDoc)
cmdLineArgs = args_re.findall(inputCmdLineDoc.decode('utf-8'))

print('='*80)
pprint(cmdLineArgs)
Expand Down