# Path: gg/utils.py
# def error_out(msg, raise_abort=True):
#     click.echo(click.style(msg, fg="red"))
#     if raise_abort:
#         raise click.Abort
# 
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# def info_out(msg):
#     click.echo(msg)
# 
# Path: gg/state.py
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# def update(configfile, data):
#     state = read(configfile)
#     state.update(data)
#     write(configfile, state)
# 
# def remove(configfile, key):
#     state = read(configfile)
#     del state[key]
#     write(configfile, state)
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


import json
import getpass
import urllib.parse
import click
import requests
from gg.utils import error_out, success_out, info_out
from gg.state import read, update, remove
from gg.main import cli, pass_config



BUGZILLA_URL = "https://bugzilla.mozilla.org"


@cli.group()
@click.option(
    "-u",
    "--bugzilla-url",
    default=BUGZILLA_URL,
    help=f"URL to Bugzilla instance (default: {BUGZILLA_URL})",
)
@pass_config
def bugzilla(config, bugzilla_url):
    """General tool for connecting to Bugzilla. The default URL
    is that for bugzilla.mozilla.org but you can override that.
    Once you're signed in you can use those credentials to automatically
    fetch bug summaries even of private bugs.
    """
    config.bugzilla_url = bugzilla_url


@bugzilla.command()
@click.argument("api_key", default="")

# Path: gg/utils.py
# def error_out(msg, raise_abort=True):
#     click.echo(click.style(msg, fg="red"))
#     if raise_abort:
#         raise click.Abort
# 
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# def info_out(msg):
#     click.echo(msg)
# 
# Path: gg/state.py
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# def update(configfile, data):
#     state = read(configfile)
#     state.update(data)
#     write(configfile, state)
# 
# def remove(configfile, key):
#     state = read(configfile)
#     del state[key]
#     write(configfile, state)
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


# Path: gg/builtins/bugzilla.py
import json
import getpass
import urllib.parse
import click
import requests
from gg.utils import error_out, success_out, info_out
from gg.state import read, update, remove
from gg.main import cli, pass_config




BUGZILLA_URL = "https://bugzilla.mozilla.org"


@cli.group()
@click.option(
    "-u",
    "--bugzilla-url",
    default=BUGZILLA_URL,
    help=f"URL to Bugzilla instance (default: {BUGZILLA_URL})",
)
@pass_config
def bugzilla(config, bugzilla_url):
    """General tool for connecting to Bugzilla. The default URL
    is that for bugzilla.mozilla.org but you can override that.
    Once you're signed in you can use those credentials to automatically
    fetch bug summaries even of private bugs.
    """
    config.bugzilla_url = bugzilla_url


@bugzilla.command()
@click.argument("api_key", default="")

@pass_config