forked from extern/httpie-cli
adapt to the new loglevel construct
This commit is contained in:
parent
366b0c3fcd
commit
34175e2d19
@ -72,7 +72,6 @@ def raw_main(
|
|||||||
return ExitStatus.SUCCESS
|
return ExitStatus.SUCCESS
|
||||||
|
|
||||||
exit_status = ExitStatus.SUCCESS
|
exit_status = ExitStatus.SUCCESS
|
||||||
check_updates(env)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
parsed_args = parser.parse_args(
|
parsed_args = parser.parse_args(
|
||||||
@ -96,6 +95,7 @@ def raw_main(
|
|||||||
raise
|
raise
|
||||||
exit_status = ExitStatus.ERROR
|
exit_status = ExitStatus.ERROR
|
||||||
else:
|
else:
|
||||||
|
check_updates(env)
|
||||||
try:
|
try:
|
||||||
exit_status = main_program(
|
exit_status = main_program(
|
||||||
args=parsed_args,
|
args=parsed_args,
|
||||||
|
@ -7,7 +7,7 @@ from typing import Any, Optional, Callable
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
import httpie
|
import httpie
|
||||||
from httpie.context import Environment, Levels
|
from httpie.context import Environment, LogLevel
|
||||||
from httpie.internal._build_channel import BUILD_CHANNEL
|
from httpie.internal._build_channel import BUILD_CHANNEL
|
||||||
from httpie.internal.daemons import spawn_daemon
|
from httpie.internal.daemons import spawn_daemon
|
||||||
from httpie.utils import is_version_greater, open_with_lockfile
|
from httpie.utils import is_version_greater, open_with_lockfile
|
||||||
@ -164,7 +164,7 @@ def check_updates(env: Environment) -> None:
|
|||||||
if current_date < earliest_warn_date:
|
if current_date < earliest_warn_date:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
env.log_error(update_status, level=Levels.WARNING)
|
env.log_error(update_status, level=LogLevel.INFO)
|
||||||
version_info['last_warned_date'] = current_date.isoformat()
|
version_info['last_warned_date'] = current_date.isoformat()
|
||||||
|
|
||||||
with open_with_lockfile(file, 'w') as stream:
|
with open_with_lockfile(file, 'w') as stream:
|
||||||
|
Loading…
Reference in New Issue
Block a user