def setUp(self): global SERVER if SERVER is not None: return self.tearDown() path = DATABASE_TEST_PATH email = '*****@*****.**' password = '******' root = None modules = [] listen_port = 8081 create_server(path, email, password, root, modules, listen_port) server = Server(path) server.start(detach=False, loop=False) SERVER = server
# # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # Import from standard library from pprint import pprint # Import from ikaaro from ikaaro.server import Server, create_server path = 'www.hforge.org' email = '*****@*****.**' password = '******' root = None modules = [] listen_port = 8081 create_server(path, email, password, root, modules, listen_port) server = Server(path) server.start(detach=False, loop=False) print('Launch reindexation') reindex_success = server.reindex_catalog(quiet=True) if reindex_success: print('Reindex was successfull') else: print('Error in reindexation') retour = server.do_request('GET', '/;_ctrl') pprint(retour) server.stop()
'-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)