4
4
# Perforce Defect Tracking Integration Project
5
5
# <http://www.ravenbrook.com/project/p4dti/>
6
6
#
7
- # MAKE_SCHEMA_DOC.PY -- GENERATE BUGZILLA SCHEMA DOCUMENTATION
7
+ # SCHEMA-TOOL -- COMMAND LINE INTERFACE TO SCHEMA MODULES
8
8
#
9
- # Nick Barnes, Ravenbrook Limited, 2003-07-07
9
+ # David Miller, Zarro Boogs Corporation, 2024-05-04
10
10
#
11
11
#
12
12
# 1. INTRODUCTION
@@ -28,10 +28,10 @@ import argparse
28
28
import subprocess
29
29
from pprint import pformat
30
30
from black import Mode , format_str
31
- from collections import OrderedDict
32
31
33
32
import schema_remarks
34
- from make_schema_doc import BzSchemaProcessingException , make_tables , version_compare
33
+ from make_schema_doc import BzSchemaProcessingException , make_tables
34
+ from pickle_schema import pickle_schema
35
35
36
36
37
37
def write_file (first , last , file ):
@@ -259,7 +259,8 @@ def generate_schema_remarks(args):
259
259
output = template .format (** var_dict )
260
260
outfile .write (output )
261
261
subprocess .run (
262
- ["diff" , "-u" , "--color" , "schema_remarks.py" , "schema_remarks_new.py" ]
262
+ ["diff" , "-u" , "--color" , "schema_remarks.py" , "schema_remarks_new.py" ],
263
+ check = True ,
263
264
)
264
265
print ("Wrote changes to schema_remarks_new.py." )
265
266
print ("If these changes are okay, move it overtop of schema_remarks.py" )
@@ -306,6 +307,9 @@ def validate_schema_remarks(_args):
306
307
sys .exit ()
307
308
print ("Versions validated." )
308
309
310
+ def pickle_parser (args ):
311
+ pickle_schema (args .version , args .db_name )
312
+ print ("Success!" )
309
313
310
314
if __name__ == "__main__" :
311
315
parser = argparse .ArgumentParser (
@@ -400,6 +404,22 @@ if __name__ == "__main__":
400
404
help = "The destination version of the schema to compare" ,
401
405
)
402
406
parser_generate .set_defaults (func = generate_schema_remarks )
407
+ parser_pickle = subparsers .add_parser (
408
+ "pickle" ,
409
+ help = "Generate a pickle file for a specific version" ,
410
+ description = "Generate a pickle file for a specific version" ,
411
+ )
412
+ parser_pickle .add_argument (
413
+ 'version' ,
414
+ metavar = 'version' ,
415
+ help = "The Bugzilla version number associated with the schema" ,
416
+ )
417
+ parser_pickle .add_argument (
418
+ 'db_name' ,
419
+ metavar = 'db_name' ,
420
+ help = "The name of the database to analyze"
421
+ )
422
+ parser_pickle .set_defaults (func = pickle_parser )
403
423
main_args = parser .parse_args ()
404
424
main_args .func (main_args )
405
425
@@ -408,12 +428,12 @@ if __name__ == "__main__":
408
428
#
409
429
# B. DOCUMENT HISTORY
410
430
#
411
- # 2001-03-08 NB Created.
431
+ # 2024-05-04 Created.
412
432
#
413
433
#
414
434
# C. COPYRIGHT AND LICENSE
415
435
#
416
- # This file is copyright (c) 2001 Perforce Software, Inc. All rights
436
+ # This file is copyright (c) 2024 Bugzilla Project Contributors. All rights
417
437
# reserved.
418
438
#
419
439
# Redistribution and use in source and binary forms, with or without
0 commit comments