@cli.command(short_help="<STR_LIT>")<EOL>@click.pass_context<EOL>def update(ctx):
ctx.obj['<STR_LIT>'].updating_projects_database()<EOL>projects = []<EOL>for backend_name, backend_uri in ctx.obj['<STR_LIT>'].get_backends():<EOL><INDENT>backend = plugins_registry.get_backend(backend_name)<EOL>backend_projects = backend.get_projects()<EOL>for project in backend_projects:<EOL><INDENT>project.backend = backend_name<EOL><DEDENT>projects += backend_projects<EOL><DEDENT>ctx.obj['<STR_LIT>'].update(projects)<EOL>shared_aliases = {}<EOL>backends_to_clear = set()<EOL>for project in projects:<EOL><INDENT>for alias, activity_id in six.iteritems(project.aliases):<EOL><INDENT>mapping = Mapping(mapping=(project.id, activity_id),<EOL>backend=project.backend)<EOL>shared_aliases[alias] = mapping<EOL>backends_to_clear.add(project.backend)<EOL><DEDENT><DEDENT>for backend in backends_to_clear:<EOL><INDENT>ctx.obj['<STR_LIT>'].clear_shared_aliases(backend)<EOL><DEDENT>current_aliases = ctx.obj['<STR_LIT>'].get_aliases()<EOL>removed_aliases = [<EOL>(alias, mapping)<EOL>for alias, mapping in current_aliases.items()<EOL>if (alias in shared_aliases and shared_aliases[alias].backend == mapping.backend<EOL>and mapping.mapping[:<NUM_LIT:2>] != shared_aliases[alias].mapping[:<NUM_LIT:2>])<EOL>]<EOL>if removed_aliases:<EOL><INDENT>ctx.obj['<STR_LIT>'].remove_aliases(removed_aliases)<EOL><DEDENT>for alias, mapping in shared_aliases.items():<EOL><INDENT>ctx.obj['<STR_LIT>'].add_shared_alias(alias, mapping)<EOL><DEDENT>aliases_after_update = ctx.obj['<STR_LIT>'].get_aliases()<EOL>ctx.obj['<STR_LIT>'].write_config()<EOL>ctx.obj['<STR_LIT>'].projects_database_update_success(<EOL>aliases_after_update, ctx.obj['<STR_LIT>']<EOL>)<EOL>
Synchronizes your project database with the server and updates the shared
aliases.