mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-01 05:54:46 +03:00
Correct issue when running Glances with minimal dep
This commit is contained in:
parent
b3828f5497
commit
746b526c51
@ -21,6 +21,7 @@ import sys
|
||||
# Version should start and end with a numerical char
|
||||
# See https://packaging.python.org/specifications/core-metadata/#version
|
||||
__version__ = '4.0.0_beta01'
|
||||
__apiversion__ = '4'
|
||||
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
|
||||
__license__ = 'LGPLv3'
|
||||
|
||||
|
@ -18,10 +18,9 @@ import socket
|
||||
from urllib.parse import urljoin
|
||||
|
||||
# Replace typing_extensions by typing when Python 3.8 support will be dropped
|
||||
# from typing import Annotated
|
||||
from typing_extensions import Annotated
|
||||
from typing import Annotated
|
||||
|
||||
from glances import __version__
|
||||
from glances import __version__, __apiversion__
|
||||
from glances.password import GlancesPassword
|
||||
from glances.timer import Timer
|
||||
from glances.logger import logger
|
||||
@ -51,7 +50,7 @@ security = HTTPBasic()
|
||||
class GlancesRestfulApi(object):
|
||||
"""This class manages the Restful API server."""
|
||||
|
||||
API_VERSION = '4'
|
||||
API_VERSION = __apiversion__
|
||||
|
||||
def __init__(self, config=None, args=None):
|
||||
# Init config
|
||||
|
@ -13,12 +13,12 @@ from pprint import pformat
|
||||
import json
|
||||
import time
|
||||
|
||||
from glances.outputs.glances_restful_api import GlancesRestfulApi
|
||||
from glances import __apiversion__
|
||||
from glances.logger import logger
|
||||
from glances.globals import iteritems
|
||||
|
||||
|
||||
API_URL = "http://localhost:61208/api/{api_version}".format(api_version=GlancesRestfulApi.API_VERSION)
|
||||
API_URL = "http://localhost:61208/api/{api_version}".format(api_version=__apiversion__)
|
||||
|
||||
APIDOC_HEADER = """\
|
||||
.. _api:
|
||||
@ -65,7 +65,7 @@ It is possible to change the Web UI refresh rate (default is 2 seconds) using th
|
||||
``http://localhost:61208/glances/?refresh=5``
|
||||
|
||||
""".format(
|
||||
api_version=GlancesRestfulApi.API_VERSION
|
||||
api_version=__apiversion__
|
||||
)
|
||||
|
||||
|
||||
|
@ -12,8 +12,9 @@
|
||||
import sys
|
||||
import time
|
||||
|
||||
from glances.globals import WINDOWS
|
||||
from glances.logger import logger
|
||||
|
||||
from glances.globals import WINDOWS
|
||||
from glances.processes import glances_processes
|
||||
from glances.stats import GlancesStats
|
||||
from glances.outputs.glances_curses import GlancesCursesStandalone
|
||||
|
Loading…
Reference in New Issue
Block a user