obsolete.py 924 B

123456789101112131415161718192021222324252627282930
  1. # -*- coding: utf-8 -*-
  2. # *****************************************************************************
  3. # Copyright (C) 2006-2020 Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
  4. # Copyright (C) 2020 Bassem Girgis. <brgirgis@gmail.com>
  5. #
  6. # Distributed under the terms of the BSD License. The full license is in
  7. # the file COPYING, distributed as part of this software.
  8. # *****************************************************************************
  9. from typing import Any, List
  10. from .api import set_clipboard_text
  11. def _make_tab(lists: List[Any]) -> str:
  12. if hasattr(lists, "tolist"):
  13. lists = lists.tolist()
  14. ut = []
  15. for rad in lists:
  16. if type(rad) in [list, tuple]:
  17. ut.append("\t".join(["%s" % x for x in rad]))
  18. else:
  19. ut.append("%s" % rad)
  20. return "\n".join(ut)
  21. def _send_data(lists: List[Any]) -> None:
  22. set_clipboard_text(_make_tab(lists))