1
1
#!/usr/bin/env python
2
2
3
- """Script to build the spec."""
3
+ """Script to build the Bikeshed (.bs) files for the UI Events spec."""
4
4
5
5
from __future__ import print_function
6
6
11
11
12
12
DEBUG = False
13
13
14
+ # This Parser processes the base *.txt files in the section/ directory to produce a set
15
+ # of output *.bs files that can be used as input to Bikeshed to create the final .html
16
+ # file.
17
+ # This pre-processing marks up the Key and Code values (with appropriate links) and
18
+ # generates HTML tables from the ASCII markup.
14
19
class Parser ():
15
20
"""Pre-bikeshed parser for uievents spec."""
16
21
@@ -274,6 +279,8 @@ def process_main_spec():
274
279
'glossary' ,
275
280
]
276
281
282
+ # Generate an .include file for each .txt file in the sections/ directory.
283
+ # These .include files are referenced by the main index.bs file.
277
284
for section in sections :
278
285
infilename = 'sections/' + section + '.txt'
279
286
outfilename = 'sections/' + section + '.include'
@@ -291,34 +298,8 @@ def process_main_spec():
291
298
cmd .append ('--line-numbers' )
292
299
subprocess .call (cmd )
293
300
294
- def process_split_spec ():
295
- # Split version of the UIEvents spec.
296
- split_sections = [
297
- 'composition-events' ,
298
- 'focus-events' ,
299
- 'input-events' ,
300
- 'keyboard-events' ,
301
- 'mouse-events' ,
302
- 'ui-events' ,
303
- 'wheel-events' ,
304
- ]
305
- for section in split_sections :
306
- infilename = 'split/' + section + '.txt'
307
- outfilename = 'split/' + section + '.bs'
308
-
309
- # Generate the bikeshed file.
310
- parser = Parser ()
311
- parser .process (infilename , outfilename )
312
-
313
- print ('Bikeshedding split specs...' )
314
- for section in split_sections :
315
- print ('...' + section )
316
- cmd = ["bikeshed" , "spec" , "split/" + section + ".bs" ]
317
- subprocess .call (cmd )
318
-
319
301
def main ():
320
302
process_main_spec ()
321
- #process_split_spec()
322
303
323
304
if __name__ == '__main__' :
324
305
main ()
0 commit comments