Skip to content

Commit 2edae70

Browse files
authored
Merge e567be0 into 28d8aa5
2 parents 28d8aa5 + e567be0 commit 2edae70

5 files changed

Lines changed: 23 additions & 5 deletions

File tree

source/addonHandler/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A part of NonVisual Desktop Access (NVDA)
22
# Copyright (C) 2012-2022 Rui Batista, NV Access Limited, Noelia Ruiz Martínez,
3-
# Joseph Lee, Babbage B.V., Arnold Loubriat, Łukasz Golonka
3+
# Joseph Lee, Babbage B.V., Arnold Loubriat, Łukasz Golonka, Leonard de Ruijter
44
# This file is covered by the GNU General Public License.
55
# See the file COPYING for more details.
66

@@ -548,6 +548,10 @@ def getDocFilePath(self, fileName=None):
548548
return docFile
549549
return None
550550

551+
def __repr__(self):
552+
return f"{self.__class__.__name__} ({self.name!r}, running={self.isRunning!r})"
553+
554+
551555
def getCodeAddon(obj=None, frameDist=1):
552556
""" Returns the L{Addon} where C{obj} is defined. If obj is None the caller code frame is assumed to allow simple retrieval of "current calling addon".
553557
@param obj: python object or None for default behaviour.

source/appModuleHandler.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: UTF-8 -*-
22
# A part of NonVisual Desktop Access (NVDA)
33
# Copyright (C) 2006-2022 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda, Joseph Lee,
4-
# Babbage B.V., Mozilla Corporation, Julien Cochuyt
4+
# Babbage B.V., Mozilla Corporation, Julien Cochuyt, Leonard de Ruijter
55
# This file is covered by the GNU General Public License.
66
# See the file COPYING for more details.
77

@@ -563,7 +563,10 @@ def _get_productVersion(self):
563563
return self.productVersion
564564

565565
def __repr__(self):
566-
return "<%r (appName %r, process ID %s) at address %x>"%(self.appModuleName,self.appName,self.processID,id(self))
566+
return (
567+
f"{self.__class__.__name__}"
568+
f"({self.appModuleName}, appName={self.appName!r}, processID={self.processID!r})"
569+
)
567570

568571
def _get_appModuleName(self):
569572
return self.__class__.__module__.split('.')[-1]

source/braille.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# A part of NonVisual Desktop Access (NVDA)
22
# This file is covered by the GNU General Public License.
33
# See the file COPYING for more details.
4-
# Copyright (C) 2008-2022 NV Access Limited, Joseph Lee, Babbage B.V., Davy Kager, Bram Duvigneau
4+
# Copyright (C) 2008-2022 NV Access Limited, Joseph Lee, Babbage B.V., Davy Kager, Bram Duvigneau,
5+
# Leonard de Ruijter
56

67
import itertools
78
import os
@@ -2498,6 +2499,9 @@ def _get_numCells(self) -> int:
24982499
"""
24992500
return 0
25002501

2502+
def __repr__(self):
2503+
return f"{self.__class__.__name__}({self.name!r}, numCells={self.numCells!r})"
2504+
25012505
def display(self, cells):
25022506
"""Display the given braille cells.
25032507
@param cells: The braille cells to display.

source/driverHandler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# A part of NonVisual Desktop Access (NVDA)
33
# This file is covered by the GNU General Public License.
44
# See the file COPYING for more details.
5-
# Copyright (C) 2006-2019 NV Access Limited, Leonard de Ruijter
5+
# Copyright (C) 2006-2022 NV Access Limited, Leonard de Ruijter
66

77
"""Handler for driver functionality that is global to synthesizers and braille displays."""
88
from autoSettingsUtils.autoSettings import AutoSettings
@@ -48,6 +48,9 @@ def terminate(self):
4848
self.saveSettings()
4949
self._unregisterConfigSaveAction()
5050

51+
def __repr__(self):
52+
return f"{self.__class__.__name__}({self.name!r})"
53+
5154
@classmethod
5255
def check(cls):
5356
"""Determine whether this driver is available.

source/globalPluginHandler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
8484
@param clsList: The list of classes, which will be modified by this method if appropriate.
8585
@type clsList: list of L{NVDAObjects.NVDAObject}
8686
"""
87+
88+
def __repr__(self):
89+
return f"{self.__class__.__name__} ({self.__class__.__module__!r})"
90+

0 commit comments

Comments
 (0)