本文整理汇总了Python中mysql.utilities.common.options.add_verbosity函数的典型用法代码示例。如果您正苦于以下问题:Python add_verbosity函数的具体用法?Python add_verbosity怎么用?Python add_verbosity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_verbosity函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: add_verbosity
# Add --datadir option
parser.add_option("--datadir", action="store", dest="datadir", default=None,
type="string", help="the data directory for the server")
# Add --search-port
parser.add_option("--port-range", action="store", dest="ports",
default="3306:3333",
type="string", help="the port range to search for running"
" mysql servers on Windows systems")
# Add --show-servers option
parser.add_option("--show-servers", action="store_true", dest="show_servers",
help="show any known MySQL servers running on this host")
# Add verbosity mode
add_verbosity(parser, False)
# Now we process the rest of the arguments.
opt, args = parser.parse_args()
# Check port range
if os.name == 'nt':
parts = opt.ports.split(":")
if len(parts) != 2:
print "# WARNING : %s is not a valid port range. Using default." % \
opt.ports
opt.ports = "3306:3333"
# Set options for database operations.
options = {
"format" : opt.format,
开发者ID:aoyanglee,项目名称:Travel-Inc,代码行数:31,代码来源:mysqlserverinfo.py
示例2: add_ssl_options
parser.add_option(
"-b",
"--start-from-beginning",
action="store_true",
default=False,
dest="from_beginning",
help="start replication from the first event recorded "
"in the binary logging of the master. Not valid "
"with --master-log-file or --master-log-pos.",
)
# Add ssl options
add_ssl_options(parser)
# Add verbosity
add_verbosity(parser)
# Now we process the rest of the arguments.
opt, args = parser.parse_args()
# Check security settings
check_password_security(opt, args)
# option --master is required (mandatory)
if not opt.master:
default_val = "[email protected]:3306"
print(WARN_OPT_USING_DEFAULT.format(default=default_val, opt="--master"))
# Print the WARNING to force determinism if a parser error occurs.
sys.stdout.flush()
# option --slave is required (mandatory)
开发者ID:fengshao0907,项目名称:mysql-utilities,代码行数:31,代码来源:mysqlreplicate.py
示例3: pattern
parser.add_option("-x", "--exclude", action="append", dest="exclude",
type="string", default=None, help="exclude one or more "
"objects from the operation using either a specific name "
"(e.g. db1.t1), a LIKE pattern (e.g. db1.t% or db%.%) or a "
"REGEXP search pattern. To use a REGEXP search pattern for "
"all exclusions, you must also specify the --regexp option. "
"Repeat the --exclude option for multiple exclusions.")
# Add the all database options
add_all(parser, "databases")
# Add the skip common options
add_skip_options(parser)
# Add verbosity and quiet (silent) mode
add_verbosity(parser, True)
# Add engine options
add_engines(parser)
# Add locking options
add_locking(parser)
# Add regexp
add_regexp(parser)
# Replication user and password
add_rpl_user(parser, None)
# Add replication options but don't include 'both'
add_rpl_mode(parser, False, False)
开发者ID:aoyanglee,项目名称:Travel-Inc,代码行数:31,代码来源:mysqldbcopy.py
示例4: keep
dest="binlog", default=None, type="string",
help="Binlog file name to keep (not to purge). All the "
"binary log files prior to the specified file will be "
"removed.")
# Add the --discover-slaves-login option.
add_discover_slaves_option(parser)
# Add the --master option.
add_master_option(parser)
# Add the --slaves option.
add_slaves_option(parser)
# Add verbosity
add_verbosity(parser, quiet=False)
# Now we process the rest of the arguments.
opt, args = parser.parse_args()
server_val = None
master_val = None
slaves_val = None
if opt.server and opt.master:
parser.error(PARSE_ERR_OPTS_EXCLD.format(opt1="--server",
opt2="--master"))
if opt.master is None and opt.slaves:
parser.error(PARSE_ERR_OPT_REQ_OPT.format(opt="--slaves",
opts="--master"))
开发者ID:fengshao0907,项目名称:mysql-utilities,代码行数:31,代码来源:mysqlbinlogpurge.py
注:本文中的mysql.utilities.common.options.add_verbosity函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论