/usr/lib/python2.7/dist-packages/traits/api.py is in python-traits 4.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | #------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
#
# Author: David C. Morrill
# Date: 12/06/2005
#
#------------------------------------------------------------------------------
""" Pseudo-package for all of the core symbols from Traits and TraitsUI.
Use this module for importing Traits names into your namespace. For example::
from traits.api import HasTraits
"""
from __future__ import absolute_import
from .trait_base import Uninitialized, Undefined, Missing, Self, python_version
from .trait_errors import TraitError, TraitNotificationError, DelegationError
from .trait_notifiers import (push_exception_handler, pop_exception_handler,
TraitChangeNotifyWrapper)
from .category import Category
from .traits import (CTrait, Trait, Property, TraitFactory, Default, Color,
RGBColor, Font)
from .trait_types import (Any, Generic, Int, Long, Float, Complex, Str, Title,
Unicode, Bytes, Bool, CInt, CLong, CFloat, CComplex, CStr, CUnicode,
CBytes, CBool, String, Regex, Code, HTML, Password, Callable, This,
self, Function, Method, Module, Python, ReadOnly, Disallow, Constant,
Delegate, DelegatesTo, PrototypedFrom, Expression, PythonValue, File,
Directory, Range, Enum, Tuple, List, CList, Set, CSet, Dict, Instance,
AdaptedTo, AdaptsTo, Event, Button, ToolbarButton, Either, Type,
Symbol, WeakRef, Date, Time, false, true, undefined, Supports)
from .trait_types import (ListInt, ListFloat, ListStr, ListUnicode,
ListComplex, ListBool, ListFunction, ListMethod,
ListThis, DictStrAny, DictStrStr, DictStrInt,
DictStrLong, DictStrFloat, DictStrBool, DictStrList)
try:
from .trait_types import Class, ListClass, ListInstance
except ImportError:
# Python 3 does not have old-style classes anymore, so Class does not exist
# interestingly, ListInstance is not equivalent to List(Instance), but
# rather only allows old-style instances.
pass
from .trait_types import (BaseInt, BaseLong, BaseFloat, BaseComplex, BaseStr,
BaseUnicode, BaseBytes, BaseBool, BaseCInt, BaseCLong, BaseCFloat,
BaseCComplex, BaseCStr, BaseCUnicode, BaseCBool, BaseFile,
BaseDirectory, BaseRange, BaseEnum, BaseTuple, BaseInstance)
from .trait_types import UUID, ValidatedTuple
from .has_traits import (HasTraits, HasStrictTraits, HasPrivateTraits,
Interface, SingletonHasTraits, SingletonHasStrictTraits,
SingletonHasPrivateTraits, MetaHasTraits, Vetoable, VetoableEvent,
implements, traits_super, on_trait_change, cached_property,
property_depends_on, provides, isinterface)
try:
from .has_traits import ABCHasTraits, ABCHasStrictTraits, ABCMetaHasTraits
except ImportError:
pass
from .trait_handlers import (BaseTraitHandler, TraitType, TraitHandler,
TraitRange, TraitString, TraitCoerceType, TraitCastType, TraitInstance,
ThisClass, TraitClass, TraitFunction, TraitEnum, TraitPrefixList,
TraitMap, TraitPrefixMap, TraitCompound, TraitList, TraitListObject,
TraitListEvent, TraitSetObject, TraitSetEvent, TraitDict,
TraitDictObject, TraitDictEvent, TraitTuple, NO_COMPARE,
OBJECT_IDENTITY_COMPARE, RICH_COMPARE)
from .trait_value import (BaseTraitValue, TraitValue, SyncValue,
TypeValue, DefaultValue)
from .adaptation.adapter import Adapter, adapts
from .adaptation.adaptation_error import AdaptationError
from .adaptation.adaptation_manager import adapt, register_factory, \
register_provides
from .trait_numeric import Array, ArrayOrNone, CArray
try:
from . import has_traits as has_traits
#---------------------------------------------------------------------------
# Patch the main traits module with the correct definition for the
# ViewElements class:
# NOTE: We do this in a try..except block because traits.ui depends on
# the pyface module (part of the TraitsGUI package) which may not
# necessarily be installed. Not having TraitsGUI means that the 'ui'
# features of traits will not work.
#---------------------------------------------------------------------------
from traitsui import view_elements
has_traits.ViewElements = view_elements.ViewElements
#-------------------------------------------------------------------------------
# Patch the main traits module with the correct definition for the
# ViewElement and ViewSubElement class:
#-------------------------------------------------------------------------------
has_traits.ViewElement = view_elements.ViewElement
except ImportError:
pass
|