2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Update API scheme to layer 78.

This commit is contained in:
John Preston
2018-04-25 13:24:48 +04:00
parent 93f6d4b6e7
commit 65f968ec1b
10 changed files with 194 additions and 80 deletions

View File

@@ -54,7 +54,13 @@ addChildParentFlags('MTPDchannelForbidden', 'MTPDchannel');
# each key flag of parentFlags should be a subset of the value flag here
parentFlagsCheck = {};
countedTypeIdExceptions = {};
countedTypeIdExceptions[77] = countedTypeIdExceptions[78] = {}
countedTypeIdExceptions[77]['channel'] = countedTypeIdExceptions[78]['channel'] = True
lines = [];
layer = '';
layerIndex = 0;
funcs = 0
types = 0;
consts = 0
@@ -83,7 +89,12 @@ with open(input_file) as f:
for line in f:
layerline = re.match(r'// LAYER (\d+)', line)
if (layerline):
layer = 'constexpr auto CurrentLayer = mtpPrime(' + layerline.group(1) + ');';
layerIndex = int(layerline.group(1));
layer = 'constexpr auto CurrentLayer = mtpPrime(' + str(layerIndex) + ');';
else:
lines.append(line);
for line in lines:
nocomment = re.match(r'^(.*?)//', line)
if (nocomment):
line = nocomment.group(1);
@@ -131,8 +142,9 @@ with open(input_file) as f:
if (typeid and len(typeid) > 0):
typeid = '0x' + typeid;
if (typeid != countTypeId):
print('Warning: counted ' + countTypeId + ' mismatch with provided ' + typeid + ' (' + cleanline + ')');
continue;
if (not layerIndex in countedTypeIdExceptions or not name in countedTypeIdExceptions[layerIndex]):
print('Warning: counted ' + countTypeId + ' mismatch with provided ' + typeid + ' (' + cleanline + ')');
continue;
else:
typeid = countTypeId;