nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.94k stars 1.53k forks source link

SyntaxError: f-string: unmatched '[' in server list (on the DEVELOP branch only) #3018

Closed nicolargo closed 1 week ago

nicolargo commented 1 week ago

Do not define any static server in the glances.conf file.

± make run-web-browser 
venv/bin/python -m glances -C conf/glances.conf -w --browser
Traceback (most recent call last):
  File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/nhe/dev/glances/glances/__main__.py", line 17, in <module>
    glances.main()
  File "/home/nhe/dev/glances/glances/__init__.py", line 173, in main
    start(config=core.get_config(), args=core.get_args())
  File "/home/nhe/dev/glances/glances/__init__.py", line 98, in start
    from glances.webserver import GlancesWebServer as GlancesMode
  File "/home/nhe/dev/glances/glances/webserver.py", line 12, in <module>
    from glances.outputs.glances_restful_api import GlancesRestfulApi
  File "/home/nhe/dev/glances/glances/outputs/glances_restful_api.py", line 23, in <module>
    from glances.servers_list import GlancesServersList
  File "/home/nhe/dev/glances/glances/servers_list.py", line 148
    self.__update_stats_rest(f'{server['uri']}/api/{__apiversion__}', server)
                                        ^
SyntaxError: f-string: unmatched '['
make: *** [Makefile:318: run-web-browser] Error 1
[nhe:~/dev/glances]↥ develop 2

± make run-browser 
venv/bin/python -m glances -C conf/glances.conf --browser
Traceback (most recent call last):
  File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/nhe/dev/glances/glances/__main__.py", line 17, in <module>
    glances.main()
  File "/home/nhe/dev/glances/glances/__init__.py", line 173, in main
    start(config=core.get_config(), args=core.get_args())
  File "/home/nhe/dev/glances/glances/__init__.py", line 92, in start
    from glances.client_browser import GlancesClientBrowser as GlancesMode
  File "/home/nhe/dev/glances/glances/client_browser.py", line 16, in <module>
    from glances.servers_list import GlancesServersList
  File "/home/nhe/dev/glances/glances/servers_list.py", line 148
    self.__update_stats_rest(f'{server['uri']}/api/{__apiversion__}', server)
                                        ^
SyntaxError: f-string: unmatched '['
make: *** [Makefile:315: run-browser] Error 1
nicolargo commented 1 week ago

Line 148:

self.__update_stats_rest(f'{server['uri']}/api/{__apiversion__}', server) 

replace ' by ":

self.__update_stats_rest(f"{server['uri']}/api/{__apiversion__}", server) 
nicolargo commented 1 week ago

And line 211 and 213 also...

nicolargo commented 1 week ago

Corrected on the develop branch.