"""
@author: Frank Brehm
@contact: frank.brehm@pixelpark.com
-@copyright: © 2021 by Frank Brehm, Berlin
+@copyright: © 2023 by Frank Brehm, Berlin
@summary: A handler module for underlaying actions
"""
from __future__ import absolute_import, print_function
from operator import attrgetter
-HAS_GETCH = False
-try:
- import getch
- HAS_GETCH = True
-except ImportError:
- pass
-
# Third party modules
import pytz
import yaml
from ..terraform.disk import TerraformDisk
+# from ..tools import password_input
+
from ..xlate import XLATOR
-__version__ = '3.9.0'
+__version__ = '3.9.1'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-# =============================================================================
-def password_input_getch(prompt='', fill_char='*', max_len=64):
- p_s = ''
- proxy_string = ' ' * 64
-
- # fch = ' '
- # if len(fill_char) >= 1:
- # fch = fill_char[0]
-
- while True:
-
- print('\r' + proxy_string, end='', flush=True)
- print('\r' + prompt, end='', flush=True)
-
- c = getch.getch()
- if c == b'\r' or c == b'\n':
- break
- elif c == b'\x08':
- if len(p_s):
- p_s = p_s[:-1]
- continue
-
- p_s += to_str(c)
- if len(p_s) >= max_len:
- break
-
- print('', flush=True)
- return p_s
-
-
-# =============================================================================
-def password_input(prompt='', fill_char='*', max_len=64):
-
- if HAS_GETCH:
- return password_input_getch(prompt=prompt, fill_char=fill_char, max_len=max_len)
-
- import getpass
-
- return getpass.getpass(prompt=prompt)
-
-
# =============================================================================
class CreateTerraformHandler(BaseHandler):
"""
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+@author: Frank Brehm
+@contact: frank.brehm@pixelpark.com
+@copyright: © 2023 by Frank Brehm, Berlin
+@summary: A handler module for underlaying actions
+"""
+from __future__ import absolute_import, print_function
+
+# Standard module
+import logging
+
+HAS_GETCH = False
+try:
+ import getch
+ HAS_GETCH = True
+except ImportError:
+ pass
+
+# Third party modules
+from fb_tools.common import to_str
+
+__version__ = '0.1.0'
+LOG = logging.getLogger(__name__)
+
+
+# =============================================================================
+def password_input_getch(prompt='', fill_char='*', max_len=64):
+ p_s = ''
+ proxy_string = ' ' * 64
+
+ while True:
+
+ print('\r' + proxy_string, end='', flush=True)
+ print('\r' + prompt, end='', flush=True)
+
+ c = getch.getch()
+ if c == b'\r' or c == b'\n':
+ break
+ elif c == b'\x08':
+ if len(p_s):
+ p_s = p_s[:-1]
+ continue
+
+ p_s += to_str(c)
+ if len(p_s) >= max_len:
+ break
+
+ print('', flush=True)
+ return p_s
+
+
+# =============================================================================
+def password_input(prompt='', fill_char='*', max_len=64):
+
+ if HAS_GETCH:
+ return password_input_getch(prompt=prompt, fill_char=fill_char, max_len=max_len)
+
+ import getpass
+
+ return getpass.getpass(prompt=prompt)
+
+
+# =============================================================================
+
+if __name__ == "__main__":
+
+ pass
+
+# =============================================================================
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 list