1# ***** BEGIN GPL LICENSE BLOCK *****
2#
3# This program is free software; you can redistribute it and/or
4# modify it under the terms of the GNU General Public License
5# as published by the Free Software Foundation; either version 2
6# of the License, or (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software Foundation,
15# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16#
17# ***** END GPL LICENSE BLOCK *****
18
19# <pep8 compliant>
20
21defs = """
22    SPACE_EMPTY,
23    SPACE_VIEW3D,
24    SPACE_IPO,
25    SPACE_OUTLINER,
26    SPACE_BUTS,
27    SPACE_FILE,
28    SPACE_IMAGE,
29    SPACE_INFO,
30    SPACE_SEQ,
31    SPACE_TEXT,
32    SPACE_IMASEL, #Deprecated
33    SPACE_SOUND, #Deprecated
34    SPACE_ACTION,
35    SPACE_NLA,
36    SPACE_SCRIPT, #Deprecated
37    SPACE_TIME, #Deprecated
38    SPACE_NODE,
39    SPACEICONMAX
40"""
41
42print('\tmod = PyModule_New("dummy");')
43print('\tPyModule_AddObject(submodule, "key", mod);')
44
45for d in defs.split('\n'):
46
47    d = d.replace(',', ' ')
48    w = d.split()
49
50    if not w:
51        continue
52
53    try:
54        w.remove("#define")
55    except:
56        pass
57
58    # print w
59
60    val = w[0]
61    py_val = w[0]
62
63    print('\tPyModule_AddObject(mod, "%s", PyLong_FromSize_t(%s));' % (val, py_val))
64