[Modeling-cvs] ProjectModeling/Modeling/scripts mdl_generate_DB_schema.py,1.7,1.8
Status: Abandoned
Brought to you by:
sbigaret
|
From: <sbi...@us...> - 2003-10-04 12:53:47
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv1395/Modeling/scripts
Modified Files:
mdl_generate_DB_schema.py
Log Message:
RFE #812708: mdl_generate_db_schema.py now automatically adds a semi-colon
(';') when option '-c' is enabled. See CHANGES & MIGRATION for details.
Index: mdl_generate_DB_schema.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/scripts/mdl_generate_DB_schema.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mdl_generate_DB_schema.py 27 Sep 2003 11:37:47 -0000 1.7
--- mdl_generate_DB_schema.py 4 Oct 2003 12:53:43 -0000 1.8
***************
*** 60,63 ****
--- 60,64 ----
administrativeConnectionDictionary={},
onlyStatements=0, continue_on_errors=0,
+ endStatementWith=';',
createUser=0, dropUser=0):
from traceback import format_list
***************
*** 94,98 ****
if onlyStatements:
for sqlExpr in sqlExprs:
! str+='%s\n'%sqlExpr.statement()
else:
context=adaptor.createAdaptorContext()
--- 95,99 ----
if onlyStatements:
for sqlExpr in sqlExprs:
! str+='%s%s\n'%(sqlExpr.statement(),endStatementWith)
else:
context=adaptor.createAdaptorContext()
***************
*** 123,130 ****
---------------
-c --stdout write the SQL statements on stdout, do not execute them
-v --verbose verbose mode
-h --help gives this help
-i --ignore-errors ignore errors (default is halt on error)
!
DB-schema generation
--------------------
--- 124,133 ----
---------------
-c --stdout write the SQL statements on stdout, do not execute them
+ -e --end-with <str> appends <str> to each statement when option -c is
+ enabled (it has no effect otherwise). Default is ';'
-v --verbose verbose mode
-h --help gives this help
-i --ignore-errors ignore errors (default is halt on error)
!
DB-schema generation
--------------------
***************
*** 233,238 ****
generation_options=_defaultOptions
try: options, args = getopt.getopt(sys.argv[1:],
! 'chivACRDdTtPpSsFf',
! ["stdout", "help", "verbose",
"ignore-errors",
"all-but-database", "create-database",
--- 236,241 ----
generation_options=_defaultOptions
try: options, args = getopt.getopt(sys.argv[1:],
! 'ce:hivACRDdTtPpSsFf',
! ["stdout", "end-with=", "help", "verbose",
"ignore-errors",
"all-but-database", "create-database",
***************
*** 244,247 ****
--- 247,251 ----
user_connection_dict={}
should_have_admin_dict=0 # set for options: -A, -C, -R, -D and -d
+ end_with_str=';'
for k, v in options:
if k in ('-h', '--help'): usage(me); return 0
***************
*** 249,252 ****
--- 253,257 ----
if k in ('-c', '--stdout'): to_stdout=1; continue
if k in ('-i', '--ignore-errors'): continue_on_errors=1; continue
+ if k in ('-e', '--end-with'): end_with_str=v; continue
if k in ('-A', '--all-but-database'):
***************
*** 345,349 ****
administrativeConnectionDictionary=admin_connection_dict,
continue_on_errors=continue_on_errors,
! onlyStatements=to_stdout)
if to_stdout:
print result
--- 350,355 ----
administrativeConnectionDictionary=admin_connection_dict,
continue_on_errors=continue_on_errors,
! onlyStatements=to_stdout,
! endStatementWith=end_with_str)
if to_stdout:
print result
|