File indexing completed on 2024-05-19 04:42:03

0001 #!/usr/bin/env python3
0002 # -*- coding: utf-8 -*-
0003 #
0004 # SPDX-FileCopyrightText: 2014 Denis Steckelmacher <steckdenis@yahoo.fr>
0005 #
0006 # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 
0008 from jsgenerator import *
0009 from common import *
0010 
0011 # Print the license of the generated file (the same as the one of this file)
0012 license()
0013 basicTypes(globals())
0014 require('event')
0015 
0016 _object = 'new Object()'
0017 _childprocess = 'new ChildProcess()'
0018 _stream = 'new stream.Stream()'
0019 
0020 Module().members(
0021     Class('ChildProcess').prototype('event.EventEmitter').members(
0022         Var(_stream, 'stdin'),
0023         Var(_stream, 'stdout'),
0024         Var(_stream, 'stderr'),
0025         Var(_int, 'pid'),
0026         Var(_bool, 'connected'),
0027         F(_void, 'kill', ('signal', _string)),
0028         F(_void, 'send', ('message', _object), ('sendHandle', _object)),
0029         F(_void, 'disconnect'),
0030     ),
0031     F(_childprocess, 'spawn', ('command', _string), ('args', _array), ('options', _object)),
0032     F(_childprocess, 'exec', ('command', _string), ('args', _array), ('callback', 'function(){}')),
0033     F(_childprocess, 'execFile', ('file', _string), ('args', _array), ('options', _object), ('callback', 'function(){}')),
0034     F(_childprocess, 'fork', ('modulePath', _string), ('args', _array), ('options', _object))
0035 ).print()