示例#1
0
    def get_basic_info(self):
        """
            Here we're asking the user for:
            - city
            - country
            - date
            - url 
            - event_email
            And return all these information.
        """
        click.echo("Hello there! Let's create new Django Girls event! So exciting!")
        click.echo("Let's start with some basics.")
        city = click.prompt(click.style("What is the name of the city?", bold=True, fg='yellow'))
        country = click.prompt(click.style("What is the name of the country?", bold=True, fg='yellow'))
        date = click.prompt(click.style("What is the date of the event? (Format: DD/MM/YYYY or MM/YYYY)", bold=True, fg='yellow'))
        date = get_approximate_date(date)
        while not date:
            date = click.prompt(click.style("Wrong format! Provide a date in format: DD/MM/YYYY or MM/YYYY)", bold=True, fg='yellow'))
            date = get_approximate_date(date)

        url = click.prompt(click.style("What should be the URL of website? djangogirls.org/xxxx", bold=True, fg='yellow'))
        event_mail = click.prompt(click.style("What is the mail adress of the event? [email protected]", bold=True, fg='yellow'))
        click.echo("Ok, got that! Your new event will happen in {0}, {1} on {2}".format(city, country, date))

        return (city, country, date, url, event_mail)
示例#2
0
    def get_basic_info(self):
        """
            Here we're asking the user for:
            - city
            - country
            - date
            - url 
            - event_email
            And return all these information.
        """
        click.echo(
            "Hello there! Let's create new Django Girls event! So exciting!")
        click.echo("Let's start with some basics.")
        city = click.prompt(
            click.style("What is the name of the city?",
                        bold=True,
                        fg='yellow'))
        country = click.prompt(
            click.style("What is the name of the country?",
                        bold=True,
                        fg='yellow'))
        date = click.prompt(
            click.style(
                "What is the date of the event? (Format: DD/MM/YYYY or MM/YYYY)",
                bold=True,
                fg='yellow'))
        date = get_approximate_date(date)
        while not date:
            date = click.prompt(
                click.style(
                    "Wrong format! Provide a date in format: DD/MM/YYYY or MM/YYYY)",
                    bold=True,
                    fg='yellow'))
            date = get_approximate_date(date)

        url = click.prompt(
            click.style(
                "What should be the URL of website? djangogirls.org/xxxx",
                bold=True,
                fg='yellow'))
        event_mail = click.prompt(
            click.style(
                "What is the mail adress of the event? [email protected]",
                bold=True,
                fg='yellow'))
        click.echo(
            "Ok, got that! Your new event will happen in {0}, {1} on {2}".
            format(city, country, date))

        return (city, country, date, url, event_mail)
示例#3
0
def gather_event_date_from_prompt():
    date = None
    while date is None:
        date_str = click.prompt(
            click.style("What is the date of the event? (Format: DD/MM/YYYY or MM/YYYY)", bold=True, fg="yellow")
        )
        date = get_approximate_date(date_str)
        if date is None:
            click.secho("Wrong format! Try again :)", bold=True, fg="red")

    return date
示例#4
0
def gather_event_date_from_prompt():
    date = None
    while date is None:
        date_str = click.prompt(
            click.style(
                "What is the date of the event? (Format: DD/MM/YYYY or MM/YYYY)",
                bold=True,
                fg='yellow'))
        date = get_approximate_date(date_str)
        if date is None:
            click.secho("Wrong format! Try again :)", bold=True, fg='red')

    return date