Skip to content

Commit d4e33cf

Browse files
committed
Improve type safety and add some info logs / comments
1 parent 4403d19 commit d4e33cf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

aw_qt/manager.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ def _discover_modules_bundled() -> List[str]:
6262
name = os.path.basename(match)
6363
modules.append(name)
6464
else:
65-
logger.warning("Found matching file but was not executable: {}".format(path))
65+
logger.warning("Found matching file but was not executable: {}".format(match))
6666

67+
# This prints "Found... set()" if we found 0 bundled modules. Can be a bit misleading.
6768
logger.info("Found bundled modules: {}".format(set(modules)))
6869
return modules
6970

@@ -208,8 +209,10 @@ def start(self, module_name: str) -> None:
208209
else:
209210
logger.debug("Manager tried to start nonexistent module {}".format(module_name))
210211

211-
def autostart(self, autostart_modules: Set[str] = set()) -> None:
212-
if autostart_modules and len(autostart_modules) > 0:
212+
def autostart(self, autostart_modules: Optional[Set[str]]) -> None:
213+
if autostart_modules is None:
214+
autostart_modules = set()
215+
if len(autostart_modules) > 0:
213216
logger.info("Modules to start weren't specified in CLI arguments. Falling back to configuration.")
214217
autostart_modules = set(self.settings.autostart_modules)
215218

aw_qt/trayicon.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,6 @@ def run(manager: Manager, testing: bool = False) -> Any:
189189

190190
QApplication.setQuitOnLastWindowClosed(False)
191191

192+
logger.info("Initialized aw-qt and trayicon succesfully")
192193
# Run the application, blocks until quit
193194
return app.exec_()

0 commit comments

Comments
 (0)