Example #1
0
def update_catalog(parser, options, target):
    # Check the server is not started, or started in read-only mode
    server = Server(target, read_only=True, cache_size=options.cache_size)
    # Ask
    message = 'Update the catalog (y/N)? '
    if ask_confirmation(message, options.confirm) is False:
        return

    # Server reindex
    server.reindex_catalog(as_test=options.test,
                           quiet=options.quiet,
                           quick=options.quick)
def update_catalog(parser, options, target):
    # Check the server is not started, or started in read-only mode
    server = Server(target, read_only=True, cache_size=options.cache_size)
    # Ask
    message = 'Update the catalog (y/N)? '
    if ask_confirmation(message, options.confirm) is False:
        return

    # Server reindex
    server.reindex_catalog(
        as_test=options.test,
        quiet=options.quiet,
        quick=options.quick)
def update_catalog(parser, options, target):
    # Check the server is not started, or started in read-only mode
    try:
        server = Server(target, read_only=True, cache_size=options.cache_size)
    except LookupError:
        print('Error: {} instance do not exists'.format(target))
        exit(1)
    # Ask
    message = 'Update the catalog (y/N)? '
    if ask_confirmation(message, options.confirm) is False:
        return

    # Server reindex
    server.reindex_catalog(as_test=options.test,
                           quiet=options.quiet,
                           quick=options.quick)
Example #4
0
#
# 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()