Skip to content

Commit

Permalink
qtile_info: config_path => PosixPath to str
Browse files Browse the repository at this point in the history
  • Loading branch information
ervinpopescu authored and elParaguayo committed Nov 15, 2023
1 parent 1259b69 commit 5203110
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libqtile/core/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import tempfile
from collections import defaultdict
from logging.handlers import RotatingFileHandler
from pathlib import Path
from typing import TYPE_CHECKING

import libqtile
Expand Down Expand Up @@ -1378,14 +1379,21 @@ def internal_windows(self) -> list[dict[str, Any]]:
@expose_command()
def qtile_info(self) -> dict:
"""Returns a dictionary of info on the Qtile instance"""
config_path = self.config.file_path
dictionary = {
"config_path": self.config.file_path,
"version": VERSION,
"log_level": self.loglevelname(),
}

if isinstance(logger.handlers[0], RotatingFileHandler):
log_path = logger.handlers[0].baseFilename
dictionary["log_path"] = log_path

if isinstance(config_path, str):
dictionary["config_path"] = config_path
elif isinstance(config_path, Path):
dictionary["config_path"] = config_path.as_posix()

return dictionary

@expose_command()
Expand Down

0 comments on commit 5203110

Please sign in to comment.