Show More
@@ -0,0 +1,17 b'' | |||||
|
1 | """Sentinel class for constants with useful reprs""" | |||
|
2 | ||||
|
3 | # Copyright (c) IPython Development Team. | |||
|
4 | # Distributed under the terms of the Modified BSD License. | |||
|
5 | ||||
|
6 | class Sentinel(object): | |||
|
7 | ||||
|
8 | def __init__(self, name, module, docstring=None): | |||
|
9 | self.name = name | |||
|
10 | self.module = module | |||
|
11 | if docstring: | |||
|
12 | self.__doc__ = docstring | |||
|
13 | ||||
|
14 | ||||
|
15 | def __repr__(self): | |||
|
16 | return str(self.module)+'.'+self.name | |||
|
17 |
@@ -0,0 +1,17 b'' | |||||
|
1 | """Sentinel class for constants with useful reprs""" | |||
|
2 | ||||
|
3 | # Copyright (c) IPython Development Team. | |||
|
4 | # Distributed under the terms of the Modified BSD License. | |||
|
5 | ||||
|
6 | class Sentinel(object): | |||
|
7 | ||||
|
8 | def __init__(self, name, module, docstring=None): | |||
|
9 | self.name = name | |||
|
10 | self.module = module | |||
|
11 | if docstring: | |||
|
12 | self.__doc__ = docstring | |||
|
13 | ||||
|
14 | ||||
|
15 | def __repr__(self): | |||
|
16 | return str(self.module)+'.'+self.name | |||
|
17 |
@@ -0,0 +1,17 b'' | |||||
|
1 | """Sentinel class for constants with useful reprs""" | |||
|
2 | ||||
|
3 | # Copyright (c) IPython Development Team. | |||
|
4 | # Distributed under the terms of the Modified BSD License. | |||
|
5 | ||||
|
6 | class Sentinel(object): | |||
|
7 | ||||
|
8 | def __init__(self, name, module, docstring=None): | |||
|
9 | self.name = name | |||
|
10 | self.module = module | |||
|
11 | if docstring: | |||
|
12 | self.__doc__ = docstring | |||
|
13 | ||||
|
14 | ||||
|
15 | def __repr__(self): | |||
|
16 | return str(self.module)+'.'+self.name | |||
|
17 |
@@ -21,7 +21,7 b' from decorator import decorator' | |||||
21 |
|
21 | |||
22 | from IPython.config.configurable import Configurable |
|
22 | from IPython.config.configurable import Configurable | |
23 | from IPython.core.getipython import get_ipython |
|
23 | from IPython.core.getipython import get_ipython | |
24 |
from IPython.utils.s |
|
24 | from IPython.utils.sentinel import Sentinel | |
25 | from IPython.lib import pretty |
|
25 | from IPython.lib import pretty | |
26 | from IPython.utils.traitlets import ( |
|
26 | from IPython.utils.traitlets import ( | |
27 | Bool, Dict, Integer, Unicode, CUnicode, ObjectName, List, |
|
27 | Bool, Dict, Integer, Unicode, CUnicode, ObjectName, List, |
@@ -815,18 +815,3 b' class Signature(object):' | |||||
815 |
|
815 | |||
816 | return rendered |
|
816 | return rendered | |
817 |
|
817 | |||
818 | ## Fake unique value as KWargs, in some places. |
|
|||
819 | # do not put docstrings here or they will appear |
|
|||
820 | # on created fake values. |
|
|||
821 | class Sentinel(object): |
|
|||
822 |
|
||||
823 | def __init__(self, name, module, docstring=None): |
|
|||
824 | self.name = name |
|
|||
825 | self.module = module |
|
|||
826 | if docstring: |
|
|||
827 | self.__doc__ = docstring |
|
|||
828 |
|
||||
829 |
|
||||
830 | def __repr__(self): |
|
|||
831 | return str(self.module)+'.'+self.name |
|
|||
832 |
|
@@ -14,7 +14,7 b' from . import v1' | |||||
14 | from . import v2 |
|
14 | from . import v2 | |
15 | from . import v3 |
|
15 | from . import v3 | |
16 | from . import v4 |
|
16 | from . import v4 | |
17 |
from |
|
17 | from .sentinel import Sentinel | |
18 |
|
18 | |||
19 | __all__ = ['versions', 'validate', 'ValidationError', 'convert', 'from_dict', |
|
19 | __all__ = ['versions', 'validate', 'ValidationError', 'convert', 'from_dict', | |
20 | 'NotebookNode', 'current_nbformat', 'current_nbformat_minor', |
|
20 | 'NotebookNode', 'current_nbformat', 'current_nbformat_minor', |
@@ -56,11 +56,11 b' from warnings import warn' | |||||
56 | from IPython.utils import py3compat |
|
56 | from IPython.utils import py3compat | |
57 | from IPython.utils import eventful |
|
57 | from IPython.utils import eventful | |
58 | from IPython.utils.getargspec import getargspec |
|
58 | from IPython.utils.getargspec import getargspec | |
59 | from IPython.utils.signatures import Sentinel |
|
|||
60 | from IPython.utils.importstring import import_item |
|
59 | from IPython.utils.importstring import import_item | |
61 | from IPython.utils.py3compat import iteritems, string_types |
|
60 | from IPython.utils.py3compat import iteritems, string_types | |
62 | from IPython.testing.skipdoctest import skip_doctest |
|
61 | from IPython.testing.skipdoctest import skip_doctest | |
63 |
|
62 | |||
|
63 | from .sentinel import Sentinel | |||
64 | SequenceTypes = (list, tuple, set, frozenset) |
|
64 | SequenceTypes = (list, tuple, set, frozenset) | |
65 |
|
65 | |||
66 | #----------------------------------------------------------------------------- |
|
66 | #----------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now