Show More
@@ -91,7 +91,13 b' def num_ini_spaces(s):' | |||||
91 | ------- |
|
91 | ------- | |
92 | n : int |
|
92 | n : int | |
93 | """ |
|
93 | """ | |
94 |
|
94 | warnings.warn( | ||
|
95 | "`num_ini_spaces` is Pending Deprecation since IPython 8.17." | |||
|
96 | "It is considered fro removal in in future version. " | |||
|
97 | "Please open an issue if you believe it should be kept.", | |||
|
98 | stacklevel=2, | |||
|
99 | category=PendingDeprecationWarning, | |||
|
100 | ) | |||
95 | ini_spaces = ini_spaces_re.match(s) |
|
101 | ini_spaces = ini_spaces_re.match(s) | |
96 | if ini_spaces: |
|
102 | if ini_spaces: | |
97 | return ini_spaces.end() |
|
103 | return ini_spaces.end() |
@@ -13,16 +13,11 b' import re' | |||||
13 | import string |
|
13 | import string | |
14 | import sys |
|
14 | import sys | |
15 | import textwrap |
|
15 | import textwrap | |
|
16 | import warnings | |||
16 | from string import Formatter |
|
17 | from string import Formatter | |
17 | from pathlib import Path |
|
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 | class LSString(str): |
|
21 | class LSString(str): | |
27 | """String derivative with a special access attributes. |
|
22 | """String derivative with a special access attributes. | |
28 |
|
23 | |||
@@ -336,7 +331,13 b" ini_spaces_re = re.compile(r'^(\\s+)')" | |||||
336 |
|
331 | |||
337 | def num_ini_spaces(strng): |
|
332 | def num_ini_spaces(strng): | |
338 | """Return the number of initial spaces in a string""" |
|
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 | ini_spaces = ini_spaces_re.match(strng) |
|
341 | ini_spaces = ini_spaces_re.match(strng) | |
341 | if ini_spaces: |
|
342 | if ini_spaces: | |
342 | return ini_spaces.end() |
|
343 | return ini_spaces.end() | |
@@ -391,6 +392,13 b' def wrap_paragraphs(text, ncols=80):' | |||||
391 | ------- |
|
392 | ------- | |
392 | list of complete paragraphs, wrapped to fill `ncols` columns. |
|
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 | paragraph_re = re.compile(r'\n(\s*\n)+', re.MULTILINE) |
|
402 | paragraph_re = re.compile(r'\n(\s*\n)+', re.MULTILINE) | |
395 | text = dedent(text).strip() |
|
403 | text = dedent(text).strip() | |
396 | paragraphs = paragraph_re.split(text)[::2] # every other entry is space |
|
404 | paragraphs = paragraph_re.split(text)[::2] # every other entry is space | |
@@ -465,6 +473,14 b' def strip_ansi(source):' | |||||
465 | source : str |
|
473 | source : str | |
466 | Source to remove the ansi from |
|
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 | return re.sub(r'\033\[(\d|;)+?m', '', source) |
|
484 | return re.sub(r'\033\[(\d|;)+?m', '', source) | |
469 |
|
485 | |||
470 |
|
486 | |||
@@ -682,6 +698,13 b' def compute_item_matrix(items, row_first=False, empty=None, *args, **kwargs) :' | |||||
682 | In [5]: all((info[k] == ideal[k] for k in ideal.keys())) |
|
698 | In [5]: all((info[k] == ideal[k] for k in ideal.keys())) | |
683 | Out[5]: True |
|
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 | info = _find_optimal(list(map(len, items)), row_first, *args, **kwargs) |
|
708 | info = _find_optimal(list(map(len, items)), row_first, *args, **kwargs) | |
686 | nrow, ncol = info['max_rows'], info['num_columns'] |
|
709 | nrow, ncol = info['max_rows'], info['num_columns'] | |
687 | if row_first: |
|
710 | if row_first: | |
@@ -709,6 +732,13 b' def columnize(items, row_first=False, separator=" ", displaywidth=80, spread=Fa' | |||||
709 | ------- |
|
732 | ------- | |
710 | The formatted string. |
|
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 | if not items: |
|
742 | if not items: | |
713 | return '\n' |
|
743 | return '\n' | |
714 | matrix, info = compute_item_matrix(items, row_first=row_first, separator_size=len(separator), displaywidth=displaywidth) |
|
744 | matrix, info = compute_item_matrix(items, row_first=row_first, separator_size=len(separator), displaywidth=displaywidth) |
General Comments 0
You need to be logged in to leave comments.
Login now