2016-08-31 11:32:17 +02:00
|
|
|
"""Commandline interface for Attract."""
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
from pillar.cli import manager
|
2016-09-08 12:42:42 +02:00
|
|
|
from pillar.api.utils import authentication
|
2016-08-31 11:32:17 +02:00
|
|
|
|
2016-09-08 12:42:42 +02:00
|
|
|
import attract.setup
|
2016-08-31 11:32:17 +02:00
|
|
|
|
2016-09-08 12:42:42 +02:00
|
|
|
log = logging.getLogger(__name__)
|
2016-08-31 11:32:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
@manager.command
|
|
|
|
@manager.option('-r', '--replace', dest='replace', action='store_true', default=False)
|
2016-09-20 14:47:23 +02:00
|
|
|
@manager.option('-s', '--svn', dest='svn_url', nargs='?')
|
|
|
|
def setup_for_attract(project_url, replace=False, svn_url=None):
|
2016-08-31 11:32:17 +02:00
|
|
|
"""Adds Attract node types to the project.
|
|
|
|
|
|
|
|
Use --replace to replace pre-existing Attract node types
|
|
|
|
(by default already existing Attract node types are skipped).
|
|
|
|
"""
|
|
|
|
|
2016-09-08 12:42:42 +02:00
|
|
|
authentication.force_cli_user()
|
2016-09-20 14:47:23 +02:00
|
|
|
attract.setup.setup_for_attract(project_url, replace=replace, svn_url=svn_url)
|