'-r', '--read-only', action="store_true", default=False, help="Start the server in read-only mode.") parser.add_option( '--quick', action="store_true", default=False, help="Do not check the database consistency.") parser.add_option( '--profile-time', action="store_true", default=False, help="Write profile information tot the 'log/profile' file.") parser.add_option( '--profile-space', action="store_true", default=False, help="Enable remote monitoring by guppy, http://guppy-pe.sf.net/") # Parse arguments options, args = parser.parse_args() n_args = len(args) if n_args != 1: parser.error('Wrong number of arguments.') # Get target target = args[0] # Set-up the server server = Server(target, read_only=options.read_only, profile_space=options.profile_space) # Check server successfully_init = server.check_consistency(options.quick) if not successfully_init: exit(1) # Start server server.start(detach=options.detach, profile=options.profile_time) # Ok exit(0)
default=False, help="Enable remote monitoring by guppy, http://guppy-pe.sf.net/") # Parse arguments options, args = parser.parse_args() n_args = len(args) if n_args != 1 and n_args != 2: parser.error('Wrong number of arguments.') # Get target target = args[0] # Set-up the server try: server = Server(target, read_only=options.read_only, profile_space=options.profile_space, port=options.port) except LookupError: print('Error: {} instance do not exists'.format(target)) exit(1) except DatabaseLockError: print('Error: Database is already opened'.format(target)) exit(1) # Check server successfully_init = server.check_consistency(options.quick) if not successfully_init: exit(1) # Start server server.start(detach=options.detach, profile=options.profile_time) # Ok exit(0)