|
13 | 13 | import string |
14 | 14 | import sys |
15 | 15 | import textwrap |
| 16 | +import warnings |
16 | 17 | from string import Formatter |
17 | 18 | from pathlib import Path |
18 | 19 |
|
19 | 20 |
|
20 | | -# datetime.strftime date format for ipython |
21 | | -if sys.platform == 'win32': |
22 | | - date_format = "%B %d, %Y" |
23 | | -else: |
24 | | - date_format = "%B %-d, %Y" |
25 | | - |
26 | 21 | class LSString(str): |
27 | 22 | """String derivative with a special access attributes. |
28 | 23 |
|
@@ -336,7 +331,13 @@ def marquee(txt='',width=78,mark='*'): |
336 | 331 |
|
337 | 332 | def num_ini_spaces(strng): |
338 | 333 | """Return the number of initial spaces in a string""" |
339 | | - |
| 334 | + warnings.warn( |
| 335 | + "`num_ini_spaces` is Pending Deprecation since IPython 8.17." |
| 336 | + "It is considered fro removal in in future version. " |
| 337 | + "Please open an issue if you believe it should be kept.", |
| 338 | + stacklevel=2, |
| 339 | + category=PendingDeprecationWarning, |
| 340 | + ) |
340 | 341 | ini_spaces = ini_spaces_re.match(strng) |
341 | 342 | if ini_spaces: |
342 | 343 | return ini_spaces.end() |
@@ -391,6 +392,13 @@ def wrap_paragraphs(text, ncols=80): |
391 | 392 | ------- |
392 | 393 | list of complete paragraphs, wrapped to fill `ncols` columns. |
393 | 394 | """ |
| 395 | + warnings.warn( |
| 396 | + "`wrap_paragraphs` is Pending Deprecation since IPython 8.17." |
| 397 | + "It is considered fro removal in in future version. " |
| 398 | + "Please open an issue if you believe it should be kept.", |
| 399 | + stacklevel=2, |
| 400 | + category=PendingDeprecationWarning, |
| 401 | + ) |
394 | 402 | paragraph_re = re.compile(r'\n(\s*\n)+', re.MULTILINE) |
395 | 403 | text = dedent(text).strip() |
396 | 404 | paragraphs = paragraph_re.split(text)[::2] # every other entry is space |
@@ -465,6 +473,14 @@ def strip_ansi(source): |
465 | 473 | source : str |
466 | 474 | Source to remove the ansi from |
467 | 475 | """ |
| 476 | + warnings.warn( |
| 477 | + "`strip_ansi` is Pending Deprecation since IPython 8.17." |
| 478 | + "It is considered fro removal in in future version. " |
| 479 | + "Please open an issue if you believe it should be kept.", |
| 480 | + stacklevel=2, |
| 481 | + category=PendingDeprecationWarning, |
| 482 | + ) |
| 483 | + |
468 | 484 | return re.sub(r'\033\[(\d|;)+?m', '', source) |
469 | 485 |
|
470 | 486 |
|
@@ -682,6 +698,13 @@ def compute_item_matrix(items, row_first=False, empty=None, *args, **kwargs) : |
682 | 698 | In [5]: all((info[k] == ideal[k] for k in ideal.keys())) |
683 | 699 | Out[5]: True |
684 | 700 | """ |
| 701 | + warnings.warn( |
| 702 | + "`compute_item_matrix` is Pending Deprecation since IPython 8.17." |
| 703 | + "It is considered fro removal in in future version. " |
| 704 | + "Please open an issue if you believe it should be kept.", |
| 705 | + stacklevel=2, |
| 706 | + category=PendingDeprecationWarning, |
| 707 | + ) |
685 | 708 | info = _find_optimal(list(map(len, items)), row_first, *args, **kwargs) |
686 | 709 | nrow, ncol = info['max_rows'], info['num_columns'] |
687 | 710 | if row_first: |
@@ -709,6 +732,13 @@ def columnize(items, row_first=False, separator=" ", displaywidth=80, spread=Fa |
709 | 732 | ------- |
710 | 733 | The formatted string. |
711 | 734 | """ |
| 735 | + warnings.warn( |
| 736 | + "`columnize` is Pending Deprecation since IPython 8.17." |
| 737 | + "It is considered fro removal in in future version. " |
| 738 | + "Please open an issue if you believe it should be kept.", |
| 739 | + stacklevel=2, |
| 740 | + category=PendingDeprecationWarning, |
| 741 | + ) |
712 | 742 | if not items: |
713 | 743 | return '\n' |
714 | 744 | matrix, info = compute_item_matrix(items, row_first=row_first, separator_size=len(separator), displaywidth=displaywidth) |
|
0 commit comments