Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9ed43d

Browse files
committed
Deprecate more complicated way of defining colors.
Keep simple with a dict.
1 parent 112e596 commit d9ed43d

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

IPython/utils/coloransi.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
import os
13+
import warnings
1314

1415
from IPython.utils.ipstruct import Struct
1516

@@ -114,8 +115,18 @@ class ColorScheme:
114115
name: str
115116
colors: Struct
116117

117-
def __init__(self,__scheme_name_,colordict=None,**colormap):
118+
def __init__(self, __scheme_name_, colordict=None, **colormap):
118119
self.name = __scheme_name_
120+
if colormap:
121+
warnings.warn(
122+
"Passing each colors as a kwarg to ColorScheme is "
123+
"considered for deprecation. Please pass a "
124+
"dict as single dict as second parameter. If you are using this"
125+
"Feature, please comment an subscribe to issue "
126+
"https://github.com/ipython/ipython/issues/14304",
127+
PendingDeprecationWarning,
128+
stacklevel=2,
129+
)
119130
if colordict is None:
120131
self.colors = Struct(**colormap)
121132
else:

0 commit comments

Comments
 (0)