whoami: add deprecation stuffs
Display the currently logged in user.
Configuration parameters:
- cache_timeout: how often we refresh this module in seconds
- (default 1800)
format: string to print (default '{username}')
Format placeholders:
@@ -21,9 +19,18 @@ class Py3status:
"""
"""
# available configuration parameters
- cache_timeout = 1800
format = '{username}'
+ class Meta:
+ deprecated = {
+ 'remove': [
+ {
+ 'param': 'cache_timeout',
+ 'msg': 'obsolete parameter',
+ },
+ ],
+ }
+
def whoami(self):
"""
We use the getpass module to get the current user.
@@ -31,7 +38,7 @@ class Py3status:
username = '{}'.format(getuser())
return {
- 'cached_until': self.py3.time_in(self.cache_timeout),
+ 'cached_until': self.py3.CACHE_FOREVER,
'full_text': self.py3.safe_format(self.format, {'username': username})
}
