|
1 | 1 | import abc |
2 | | -import warnings |
3 | 2 | from typing import Dict, List, Optional, Tuple |
4 | 3 |
|
5 | 4 | from yamcs.protobuf.mdb import mdb_pb2 |
@@ -31,32 +30,19 @@ def qualified_name(self) -> str: |
31 | 30 | return self._proto.qualifiedName |
32 | 31 |
|
33 | 32 | @property |
34 | | - def aliases(self) -> List[Tuple[str, str]]: |
35 | | - """ |
36 | | - List of (namespace, name) pairs, as 2-tuples |
37 | | -
|
38 | | - .. deprecated:: 1.9.2 |
39 | | - Use :attr:`aliases_dict` instead, which returns a dictionary instead of |
40 | | - a list of 2-tuples. |
41 | | -
|
42 | | - In a future release, the ``aliases`` property will be changed to match the |
43 | | - return type of :attr:`aliases_dict`. |
44 | | - """ |
45 | | - warnings.warn( |
46 | | - "Use 'aliases_dict' instead of 'aliases'. This returns " |
47 | | - "a dictionary instead of a list of 2-tuples. In a future release, " |
48 | | - "the 'aliases' property will be changed to match the return type " |
49 | | - "of 'aliases_dict'.", |
50 | | - category=FutureWarning, |
51 | | - ) |
52 | | - return list( |
53 | | - {alias.namespace: alias.name for alias in self._proto.alias}.items() |
54 | | - ) |
| 33 | + def aliases(self) -> Dict[str, str]: |
| 34 | + """Aliases, keyed by namespace""" |
| 35 | + return {alias.namespace: alias.name for alias in self._proto.alias} |
55 | 36 |
|
56 | 37 | @property |
57 | 38 | def aliases_dict(self) -> Dict[str, str]: |
58 | | - """Aliases, keyed by namespace""" |
59 | | - return {alias.namespace: alias.name for alias in self._proto.alias} |
| 39 | + """ |
| 40 | + Aliases, keyed by namespace |
| 41 | +
|
| 42 | + This method shall be deprecated in a future release. Use |
| 43 | + :attr:`aliases` instead. |
| 44 | + """ |
| 45 | + return self.aliases |
60 | 46 |
|
61 | 47 | @property |
62 | 48 | def description(self) -> Optional[str]: |
|
0 commit comments