Пример #1
0
def main():
    if not os.path.exists(os.path.join("reviewboard", "manage.py")):
        sys.stderr.write("This must be run from the top-level Review Board "
                         "directory\n")
        sys.exit(1)


    # Insert the current directory first in the module path so we find the
    # correct reviewboard package.
    sys.path.insert(0, os.getcwd())
    from reviewboard.cmdline.rbsite import Site

    parse_options(sys.argv[1:])

    # Re-use the Site class, since it has some useful functions.
    site = Site("reviewboard", SiteOptions)

    create_settings()
    build_egg_info()

    if options.install_media:
        install_media(site)

    if options.sync_db:
        print "Synchronizing database..."
        site.abs_install_dir = os.getcwd()
        site.sync_database(allow_input=True)

    print
    print "Your Review Board tree is ready for development."
    print
Пример #2
0
def main():
    if not os.path.exists(os.path.join("reviewboard", "manage.py")):
        sys.stderr.write("This must be run from the top-level Review Board "
                         "directory\n")
        sys.exit(1)

    # Insert the current directory first in the module path so we find the
    # correct reviewboard package.
    sys.path.insert(0, os.getcwd())
    from reviewboard.cmdline.rbsite import Site

    parse_options(sys.argv[1:])

    # Re-use the Site class, since it has some useful functions.
    site = Site("reviewboard", SiteOptions)

    create_settings()
    build_egg_info()

    if options.install_media:
        install_media(site)

    if options.sync_db:
        print "Synchronizing database..."
        site.abs_install_dir = os.getcwd()
        site.sync_database(allow_input=True)

    print
    print "Your Review Board tree is ready for development."
    print
Пример #3
0
def main():
    """The entry point of the prepare-dev script."""
    if not os.path.exists(os.path.join("reviewboard", "manage.py")):
        sys.stderr.write("This must be run from the top-level Review Board "
                         "directory\n")
        sys.exit(1)

    options = parse_options(sys.argv[1:])

    if options.install_deps:
        install_dependencies()

    # Insert the current directory first in the module path so we find the
    # correct reviewboard package.
    sys.path.insert(0, os.getcwd())
    from reviewboard.cmdline.rbsite import Site, ConsoleUI

    import reviewboard.cmdline.rbsite
    reviewboard.cmdline.rbsite.ui = ConsoleUI()

    # Re-use the Site class, since it has some useful functions.
    site_path = os.path.abspath('reviewboard')
    site = Site(site_path, SiteOptions)

    create_settings(options)

    if options.install_hooks:
        install_git_hooks()

    if options.install_media:
        install_media(site)

    try:
        if options.sync_db:
            site.abs_install_dir = os.getcwd()
            site.setup_settings()
            site.update_database(allow_input=True,
                                 report_progress=True)
    except KeyboardInterrupt:
        sys.stderr.write(
            'The process was canceled in the middle of creating the database, '
            'which can result in a corrupted setup. Please remove the '
            'database file and run ./reviewboard/manage.py syncdb.')
        return

    print()
    print('Your Review Board tree is ready for development.')
    print()
Пример #4
0
def main():
    """The entry point of the prepare-dev script."""
    if not os.path.exists(os.path.join("reviewboard", "manage.py")):
        sys.stderr.write("This must be run from the top-level Review Board "
                         "directory\n")
        sys.exit(1)

    options = parse_options(sys.argv[1:])

    if options.install_deps:
        install_dependencies()

    # Insert the current directory first in the module path so we find the
    # correct reviewboard package.
    sys.path.insert(0, os.getcwd())
    from reviewboard.cmdline.rbsite import Site, ConsoleUI

    import reviewboard.cmdline.rbsite
    reviewboard.cmdline.rbsite.ui = ConsoleUI()

    # Re-use the Site class, since it has some useful functions.
    site_path = os.path.abspath('reviewboard')
    site = Site(site_path, SiteOptions)

    create_settings(options)

    if options.install_hooks:
        install_git_hooks()

    if options.install_media:
        install_media(site)

    try:
        if options.sync_db:
            print('Synchronizing database...')
            site.abs_install_dir = os.getcwd()
            site.sync_database(allow_input=True)
    except KeyboardInterrupt:
        sys.stderr.write(
            'The process was canceled in the middle of creating the database, '
            'which can result in a corrupted setup. Please remove the '
            'database file and run ./reviewboard/manage.py syncdb.')
        return

    print()
    print('Your Review Board tree is ready for development.')
    print()
Пример #5
0
def main():
    if not os.path.exists(os.path.join("reviewboard", "manage.py")):
        sys.stderr.write("This must be run from the top-level Review Board "
                         "directory\n")
        sys.exit(1)

    # Insert the current directory first in the module path so we find the
    # correct reviewboard package.
    sys.path.insert(0, os.getcwd())
    from reviewboard.cmdline.rbsite import Site, ConsoleUI

    parse_options(sys.argv[1:])

    import reviewboard.cmdline.rbsite
    reviewboard.cmdline.rbsite.ui = ConsoleUI()

    # Re-use the Site class, since it has some useful functions.
    site_path = os.path.abspath('reviewboard')
    site = Site(site_path, SiteOptions)

    create_settings()
    build_egg_info()

    if options.install_media:
        install_media(site)

    try:
        if options.sync_db:
            print("Synchronizing database...")
            site.abs_install_dir = os.getcwd()
            site.sync_database(allow_input=True)

        print()
        print("Your Review Board tree is ready for development.")
        print()
    except KeyboardInterrupt:
        sys.stderr.write(
            'The process was canceled in the middle of creating the database, '
            'which can result in a corrupted setup. Please remove the '
            'database file and run prepare-dev.py again.')
Пример #6
0
def main():
    """The entry point of the prepare-dev script."""
    global ui

    if not os.path.exists(os.path.join("reviewboard", "manage.py")):
        sys.stderr.write("This must be run from the top-level Review Board "
                         "directory\n")
        sys.exit(1)

    options = parse_options(sys.argv[1:])

    if options.install_deps:
        install_dependencies()

    # Insert the current directory first in the module path so we find the
    # correct reviewboard package.
    sys.path.insert(0, os.getcwd())
    from reviewboard.cmdline.rbsite import Site, ConsoleUI

    import reviewboard.cmdline.rbsite
    ui = ConsoleUI()
    reviewboard.cmdline.rbsite.ui = ui

    page = ui.page('Welcome to Review Board!')
    ui.text(page,
            "Let's get your development environment set up and ready to go. "
            "This will set up your settings_local.py file, your database, "
            "initial static media files, and prepare an administrator "
            "account.")
    ui.text(page,
            "If you have any issues, first see if it's answered in our FAQ:")
    ui.urllink(page, FAQ_URL)
    ui.text(page,
            "If you're a student working on Review Board, you can also "
            "get help from your mentors. If you're a contributor, please "
            "contact [email protected]")

    # Re-use the Site class, since it has some useful functions.
    site_path = os.path.abspath('reviewboard')
    site = Site(site_path, SiteOptions)

    create_settings(options)

    if options.install_hooks:
        install_git_hooks()

    try:
        if options.sync_db:
            site.abs_install_dir = os.getcwd()

            ui.page('Setting up the Review Board database')
            site.setup_settings()
            site.update_database(allow_input=True,
                                 report_progress=True)
    except KeyboardInterrupt:
        ui.error(
            'The process was canceled in the middle of creating the database, '
            'which can result in a corrupted setup. Please remove the '
            'database file and run `./reviewboard/manage.py evolve --execute`')
        return

    if options.install_media:
        install_media(site)

    create_superuser(site)

    page = ui.page('Your Review Board tree is ready for development!')
    ui.text(page,
            'You can now run your development server by running '
            '`./contrib/internal/devserver.py`')
Пример #7
0
def main():
    """The entry point of the prepare-dev script."""
    global console

    if not os.path.exists(os.path.join("reviewboard", "manage.py")):
        sys.stderr.write("This must be run from the top-level Review Board "
                         "directory\n")
        sys.exit(1)

    options = parse_options(sys.argv[1:])

    if options.install_deps:
        install_dependencies(options)

    # Insert the current directory first in the module path so we find the
    # correct reviewboard package.
    sys.path.insert(0, os.getcwd())

    from reviewboard.cmdline import rbsite
    from reviewboard.cmdline.rbsite import Site, setup_rbsite
    from reviewboard.cmdline.utils.console import get_console

    setup_rbsite()

    console = get_console()
    console.allow_color = True

    console.header('Welcome to Review Board!', leading_newlines=False)
    console.print(
        "Let's get your development environment set up and ready to go. This "
        "will set up your settings_local.py file, your database, initial "
        "static media files, and prepare an administrator account."
        "\n"
        "If you have any issues, first see if it's answered in our FAQ:"
        "\n"
        "%(faq_url)s"
        "\n"
        "If you're a student working on Review Board, you can also get help "
        "from your mentors. If you're a contributor, please contact:"
        "\n"
        "*****@*****.**" % {
            'faq_url': FAQ_URL,
        })

    # Re-use the Site class, since it has some useful functions.
    site_path = os.path.abspath('reviewboard')
    site = Site(site_path, SiteOptions)

    create_settings(options)

    if options.install_hooks:
        install_git_hooks()

    try:
        if options.sync_db:
            site.abs_install_dir = os.getcwd()

            console.header('Setting up the Review Board database')
            site.setup_settings()
            site.update_database(allow_input=True, report_progress=True)
    except KeyboardInterrupt:
        console.error(
            'The process was canceled in the middle of creating the database, '
            'which can result in a corrupted setup. Please remove the '
            'database file and run:')
        console.error('    ./reviewboard/manage.py createdb', wrap=False)
        return

    if options.install_media:
        install_media(site)

    create_superuser(site)

    console.header('Your Review Board tree is ready for development!')
    console.print('You can now run your development server by running:')
    console.print()
    console.print('    ./contrib/internal/devserver.py', wrap=False)
    console.print()