From d794275303325de30746e1d21bbd6e4327d3e9ae Mon Sep 17 00:00:00 2001 From: aaronayres35 <36972686+aaronayres35@users.noreply.github.com> Date: Tue, 24 Nov 2020 11:00:54 -0600 Subject: [PATCH] Remove apptools.naming.ui submodule (#233) * remove apptools.naming.ui submodule * add a news fragment * Update image_LICENSE.txt Co-authored-by: Poruri Sai Rahul * update image_LICENSE.txt file with suggestion from PR review Co-authored-by: Poruri Sai Rahul --- apptools/naming/ui/__init__.py | 13 --- apptools/naming/ui/api.py | 20 ---- apptools/naming/ui/context_monitor.py | 108 -------------------- apptools/naming/ui/context_node_type.py | 96 ----------------- apptools/naming/ui/explorer.py | 95 ----------------- apptools/naming/ui/images/closed_folder.png | Bin 533 -> 0 bytes apptools/naming/ui/images/document.png | Bin 333 -> 0 bytes apptools/naming/ui/images/image_LICENSE.txt | 14 --- apptools/naming/ui/images/open_folder.png | Bin 617 -> 0 bytes apptools/naming/ui/naming_node_manager.py | 51 --------- apptools/naming/ui/naming_tree.py | 72 ------------- apptools/naming/ui/naming_tree_model.py | 54 ---------- apptools/naming/ui/object_node_type.py | 74 -------------- docs/releases/upcoming/233.removal.rst | 1 + examples/naming/explorer.py | 47 --------- image_LICENSE.txt | 10 -- setup.py | 1 - 17 files changed, 1 insertion(+), 655 deletions(-) delete mode 100644 apptools/naming/ui/__init__.py delete mode 100644 apptools/naming/ui/api.py delete mode 100644 apptools/naming/ui/context_monitor.py delete mode 100644 apptools/naming/ui/context_node_type.py delete mode 100644 apptools/naming/ui/explorer.py delete mode 100644 apptools/naming/ui/images/closed_folder.png delete mode 100644 apptools/naming/ui/images/document.png delete mode 100644 apptools/naming/ui/images/image_LICENSE.txt delete mode 100644 apptools/naming/ui/images/open_folder.png delete mode 100644 apptools/naming/ui/naming_node_manager.py delete mode 100644 apptools/naming/ui/naming_tree.py delete mode 100644 apptools/naming/ui/naming_tree_model.py delete mode 100644 apptools/naming/ui/object_node_type.py create mode 100644 docs/releases/upcoming/233.removal.rst delete mode 100644 examples/naming/explorer.py diff --git a/apptools/naming/ui/__init__.py b/apptools/naming/ui/__init__.py deleted file mode 100644 index dd56fdd8c..000000000 --- a/apptools/naming/ui/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ diff --git a/apptools/naming/ui/api.py b/apptools/naming/ui/api.py deleted file mode 100644 index f10fc340a..000000000 --- a/apptools/naming/ui/api.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -from .context_monitor import ContextMonitor -from .context_node_type import ContextNodeType -from .explorer import Explorer, explore -from .naming_node_manager import NamingNodeManager -from .naming_tree import NamingTree -from .naming_tree_model import NamingTreeModel -from .object_node_type import ObjectNodeType diff --git a/apptools/naming/ui/context_monitor.py b/apptools/naming/ui/context_monitor.py deleted file mode 100644 index 30868e5a5..000000000 --- a/apptools/naming/ui/context_monitor.py +++ /dev/null @@ -1,108 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -""" A monitor that detects changes to a naming context. """ - - -# Enthought library imports. -from pyface.tree.api import NodeMonitor - - -class ContextMonitor(NodeMonitor): - """ A monitor that detects changes to a naming context. """ - - ########################################################################### - # 'NodeMonitor' interface. - ########################################################################### - - def start(self): - """ Start listening to changes to the object. """ - - context = self.node.obj - - context.on_trait_change(self._on_object_added, "object_added") - context.on_trait_change(self._on_object_changed, "object_changed") - context.on_trait_change(self._on_object_removed, "object_removed") - context.on_trait_change(self._on_object_renamed, "object_renamed") - context.on_trait_change(self._on_context_changed, "context_changed") - - return - - def stop(self): - """ Stop listening to changes to the object. """ - - context = self.node.obj - - context.on_trait_change( - self._on_object_added, "object_added", remove=True - ) - - context.on_trait_change( - self._on_object_changed, "object_changed", remove=True - ) - - context.on_trait_change( - self._on_object_removed, "object_removed", remove=True - ) - - context.on_trait_change( - self._on_object_renamed, "object_renamed", remove=True - ) - - context.on_trait_change( - self._on_context_changed, "context_changed", remove=True - ) - - return - - ########################################################################### - # Private interface. - ########################################################################### - - #### Trait event handlers ################################################# - - def _on_object_added(self, event): - """ Called when an object has been added to the context. """ - - self.fire_nodes_inserted([event.new_binding]) - - return - - def _on_object_changed(self, event): - """ Called when an object in the context has been changed. """ - - # fixme: Can we get enough information to fire a 'nodes_replaced' - # event? Something a little more granular than this! - self.fire_structure_changed() - - return - - def _on_object_removed(self, event): - """ Called when an object has been removed from the context. """ - - self.fire_nodes_removed([event.old_binding]) - - return - - def _on_object_renamed(self, event): - """ Called when an object has been renamed in the context. """ - - self.fire_nodes_replaced([event.old_binding], [event.new_binding]) - - return - - def _on_context_changed(self, event): - """ Called when a context has changed dramatically. """ - self.fire_structure_changed() - - return diff --git a/apptools/naming/ui/context_node_type.py b/apptools/naming/ui/context_node_type.py deleted file mode 100644 index e463d31b3..000000000 --- a/apptools/naming/ui/context_node_type.py +++ /dev/null @@ -1,96 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -""" The node type for contexts in a naming system. """ - -from __future__ import print_function - -# Enthought library imports. -from apptools.naming.api import Context -from pyface.tree.api import NodeType - -# Local imports. -from .context_monitor import ContextMonitor - - -class ContextNodeType(NodeType): - """ The node type for contexts in a naming system. """ - - ########################################################################### - # 'NodeType' interface. - ########################################################################### - - # 'node' in this case is a 'Binding' instance whose 'obj' trait is a - # 'Context' instance. - def is_type_for(self, node): - """ Returns True if this node type recognizes a node. """ - - return isinstance(node.obj, Context) - - def allows_children(self, node): - """ Does the node allow children (ie. a folder vs a file). """ - - return True - - def has_children(self, node): - """ Returns True if a node has children, otherwise False. """ - - return len(node.obj.list_names("")) > 0 - - def get_children(self, node): - """ Returns the children of a node. """ - - return node.obj.list_bindings("") - - def get_drag_value(self, node): - """ Get the value that is dragged for a node. """ - - return node.obj - - def is_editable(self, node): - """ Returns True if the node is editable, otherwise False. """ - - # You can't rename the root context! - return node.context is not None - - def get_text(self, node): - """ Returns the label text for a node. """ - - return node.name - - def can_set_text(self, node, text): - """ Returns True if the node's label can be set. """ - - # The parent context will NOT be None here (see 'is_editable'). - parent = node.context - - return len(text.strip()) > 0 and text not in parent.list_names("") - - def set_text(self, node, text): - """ Sets the label text for a node. """ - - print("Setting text on", node.name, node.obj) - print("Context details", node.obj.name, node.obj.path) - - # Do the rename in the naming system. - node.context.rename(node.name, text) - - # Update the binding. - node.name = text - - return - - def get_monitor(self, node): - """ Returns a monitor that detects changes to a node. """ - - return ContextMonitor(node=node) diff --git a/apptools/naming/ui/explorer.py b/apptools/naming/ui/explorer.py deleted file mode 100644 index dbe8cea05..000000000 --- a/apptools/naming/ui/explorer.py +++ /dev/null @@ -1,95 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -""" A naming system explorer. """ - - -# Enthought library imports. -from apptools.naming.api import Binding, PyContext -from pyface.api import PythonShell, SplitApplicationWindow -from traits.api import Float, Instance, Str - -# Local imports. -from .naming_tree import NamingTree - - -# Factory function for exploring a Python namespace. -def explore(obj): - """ View a Python object as a naming context. """ - - root = Binding(name="root", obj=PyContext(namespace=obj)) - - explorer = Explorer(root=root, size=(1200, 400)) - explorer.open() - - return - - -class Explorer(SplitApplicationWindow): - """ The main application window. """ - - #### 'Window' interface ################################################### - - title = Str("Naming System Explorer") - - #### 'SplitApplicationWindow' interface ################################### - - # The direction in which the panel is split. - direction = Str("vertical") - - # The ratio of the size of the left/top pane to the right/bottom pane. - ratio = Float(0.3) - - # The root binding (usually a binding to a context!). - root = Instance(Binding) - - ########################################################################### - # Protected 'SplitApplicationWindow' interface. - ########################################################################### - - def _create_lhs(self, parent): - """ Creates the left hand side or top depending on the style. """ - - return self._create_tree(parent, self.root) - - def _create_rhs(self, parent): - """ Creates the panel containing the selected preference page. """ - - return self._create_python_shell(parent) - - ########################################################################### - # Private interface. - ########################################################################### - - def _create_tree(self, parent, root): - """ Creates the tree. """ - - self._tree = tree = NamingTree(parent, root=root) - - return tree.control - - def _create_python_shell(self, parent): - """ Creates the Python shell. """ - - self._python_shell = python_shell = PythonShell(parent) - - # Bind useful names. - python_shell.bind("widget", self._tree) - python_shell.bind("w", self._tree) - python_shell.bind("window", self) - python_shell.bind("explore", explore) - - # Execute useful commands to bind useful names ;^) - python_shell.execute_command("from apptools.naming.api import *") - - return python_shell.control diff --git a/apptools/naming/ui/images/closed_folder.png b/apptools/naming/ui/images/closed_folder.png deleted file mode 100644 index 302fb33a0550c8ab622c050c00e34e94ad585a85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 533 zcmV+w0_y#VP)Gx} zk@W)v5J-^W_m_(p1}BzY1(Mo(3Aqd)fWQX)`||-J`yVLA$ONW;zTXcu1RZE!1sdWA zWE=$<01!YB1Ae_>`1Ac9!EHt@9l>f0uVq@7rX;&#%?1npbav_0w91O2K;^l z7W(z+1k@{k8UFwO1EhZgee(;5e}dT{Z-0BSf`L;k5N3)iKmb7vc*_8xKQJ%?!vLZA z4@5Hqi2e-``}-BB?jy_qVSoUF8t@)!@h67=KwJL*`v=wpb_vh`xGNYS2Eqd!7~}u} z1U29t#07soLSh1F3`i3w{rvy;18O_O6=1`Fu7Cl6078jIa9I5R4{;4r7(fjA12*LE z-`^+(00a;V#Oa?IkX-_C0Yn3c4RQKEu*~0o3{dZY!4H4{0wqf=V7!tNf3Os}3P`O7 z2q2IFtUzoC#Lhr0M5O-jKzsp+_W}eEEMtIZcBo;*08s7(1c-+2*wv2(<2J_t+h+ zs5rlI{^p#SO2-|aiODDi-jZP}W|aE1)~BmOR3$EA(Vi@w>U%ZDa$9qM8}c0HKK>=@ z`d4d)YqwsmShMx=n<-}wTJ%-CXPi)?Z+d)E$Kx3$zTq0>%B>G-<`ESK<06 zKLv;!Rde(>`RU=L2g~Ovo%n1M@bQ?*+>S*Vvl$k=|9v$za@qmb9gNTaiaD`NnxMxo zp5*#q&TW}{<`>WDw{ULpSLj^#x@qe3m+d`GEQ*uw+Md|dvtPsTSdE!)vF)Ukp32Aj azp#b`#_#;I)BX+6mkge+elF{r5}E*#afeO- diff --git a/apptools/naming/ui/images/image_LICENSE.txt b/apptools/naming/ui/images/image_LICENSE.txt deleted file mode 100644 index 9315e5c53..000000000 --- a/apptools/naming/ui/images/image_LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -The icons are mostly derived work from other icons. As such they are -licensed accordingly to the original license: - - GV: Gael Varoquaux: BSD-like - -Unless stated in this file, icons are work of enthought, and are released -under BSD-like license. -Files and orginal authors: ----------------------------------------------------------------- - closed_folder.png | GV - document.png | GV - open_folder.png | GV - - diff --git a/apptools/naming/ui/images/open_folder.png b/apptools/naming/ui/images/open_folder.png deleted file mode 100644 index e06d13c46a6d9b243da6679e42e5df2d38fce00a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 617 zcmV-v0+#)WP)Mj%b%YX(-yFO?GsoOyOn*k312p|Ta=Knw5?Zv<#aiF{t5OV=B3lK8{F(bNu zfB*tXF#P^<4a4BvinTy8crPJW0R#}(fdBu#L%IJzJ_6IfKAnadf((MM0u6BnGEM+7 zNYj6S00JBE@Ao?(6KE(SD_Gf&w_6z&uX~Kk%V1Ysx&6Cn;rg#L0RjkWz#F)Nzds&; zHD?#kWnf|zz!`RvJA(Uw)HQ$rf*A1U16<pq9q~0R;5|#078Oeue}kNHfD`(co;0RjkY07$cs0|$eMq#;o47f8VU{|9#k%pj0DsO_M1 zzzxz15I~@$sRfMNs|-W}paK0rsuzf#flLPoAdmr|)ME(5pcE!VKtITN2Y~n}I9`DO zAb?<*14Oe!4Z{aOx%L-KGY9|#5aa*<{~0I&009O7FpU0?6zc={00000NkvXXu0mjf D(y;+k diff --git a/apptools/naming/ui/naming_node_manager.py b/apptools/naming/ui/naming_node_manager.py deleted file mode 100644 index cdd08db29..000000000 --- a/apptools/naming/ui/naming_node_manager.py +++ /dev/null @@ -1,51 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -""" The node manager for a naming tree. """ - - -# Enthought library imports. -from pyface.tree.api import NodeManager - - -class NamingNodeManager(NodeManager): - """ The node manager for a naming tree. """ - - ########################################################################### - # 'NodeManager' interface. - ########################################################################### - - def get_key(self, node): - """ Generates a unique key for a node. """ - - # fixme: This scheme does NOT allow the same object to be in the tree - # in more than one place. - return self._get_hash_value(node.obj) - - ########################################################################### - # Private interface. - ########################################################################### - - def _get_hash_value(self, obj): - """ Returns a hash value for an object. """ - - # We do it like this 'cos, for example, using id() on a string - # doesn't give us what we want, but things like lists aren't - # hashable, so we can't always use hash()). - try: - hash_value = hash(obj) - - except: - hash_value = id(obj) - - return hash_value diff --git a/apptools/naming/ui/naming_tree.py b/apptools/naming/ui/naming_tree.py deleted file mode 100644 index 1aa0f7229..000000000 --- a/apptools/naming/ui/naming_tree.py +++ /dev/null @@ -1,72 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -""" A tree view of a naming system. """ - - -# Enthought library imports. -from apptools.naming.api import OperationNotSupportedError -from pyface.tree.api import NodeTree -from traits.api import Instance - -# Local imports. -from .naming_tree_model import NamingTreeModel - - -class NamingTree(NodeTree): - """ A tree view of a naming system. """ - - #### 'Tree' interface ##################################################### - - # The model that provides the data for the tree. - model = Instance(NamingTreeModel) - - ########################################################################### - # 'Tree' interface. - ########################################################################### - - #### Trait initializers ################################################### - - def _model_default(self): - """ Initializes the model trait. """ - - return NamingTreeModel() - - ########################################################################### - # 'NamingTree' interface. - ########################################################################### - - def ensure_visible(self, node): - """ Make sure that the specified node is visible. """ - - try: - components = node.namespace_name.split("/") - - # Make sure that the tree is expanded down to the context that - # contains the node. - binding = self.root - for atom in components[:-1]: - binding = binding.obj.lookup_binding(atom) - self.expand(binding) - - # The context is expanded so we know that the node will be in the - # node to Id map. - wxid = self._node_to_id_map.get(self.model.get_key(node), None) - self.control.EnsureVisible(wxid) - - # We need 'namespace_name' to make this work. If we don't have it - # then we simply cannot do this! - except OperationNotSupportedError: - binding = None - - return binding diff --git a/apptools/naming/ui/naming_tree_model.py b/apptools/naming/ui/naming_tree_model.py deleted file mode 100644 index 7e8804e25..000000000 --- a/apptools/naming/ui/naming_tree_model.py +++ /dev/null @@ -1,54 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -""" The model for a tree view of a naming system. """ - - -# Enthought library imports. -from apptools.naming.api import Binding -from pyface.tree.api import NodeTreeModel -from traits.api import Instance - -# Local imports. -from .context_node_type import ContextNodeType -from .naming_node_manager import NamingNodeManager -from .object_node_type import ObjectNodeType - - -class NamingTreeModel(NodeTreeModel): - """ The model for a tree view of a naming system. """ - - #### 'TreeModel' interface ################################################ - - # The root of the model. - root = Instance(Binding) - - #### 'NodeTreeModel' interface ############################################ - - # The node manager looks after all node types. - node_manager = Instance(NamingNodeManager) - - ########################################################################### - # 'NodeTreeModel' interface. - ########################################################################### - - #### Trait initializers ################################################### - - def _node_manager_default(self): - """ Initializes the node manaber trait. """ - - node_manager = NamingNodeManager() - node_manager.add_node_type(ContextNodeType()) - node_manager.add_node_type(ObjectNodeType()) - - return node_manager diff --git a/apptools/naming/ui/object_node_type.py b/apptools/naming/ui/object_node_type.py deleted file mode 100644 index 30897e5f1..000000000 --- a/apptools/naming/ui/object_node_type.py +++ /dev/null @@ -1,74 +0,0 @@ -# ------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -# ------------------------------------------------------------------------------ -""" The node type for NON-contexts in a naming system. """ - - -# Enthought library imports. -from apptools.naming.api import Context -from pyface.tree.api import NodeType - - -class ObjectNodeType(NodeType): - """ The node type for NON-contexts in a naming system. """ - - ########################################################################### - # 'NodeType' interface. - ########################################################################### - - # 'node' in this case is a 'Binding' instance. - def is_type_for(self, node): - """ Returns True if this node type recognized a node. """ - - return True - - def allows_children(self, node): - """ Does the node allow children (ie. a folder vs a file). """ - - return False - - def get_drag_value(self, node): - """ Get the value that is dragged for a node. """ - - return node.obj - - def is_editable(self, node): - """Returns True if the node is editable, otherwise False. - - If the node is editable, its text can be set via the UI. - - """ - - return True - - def get_text(self, node): - """ Returns the label text for a node. """ - - return node.name - - def can_set_text(self, node, text): - """ Returns True if the node's label can be set. """ - - # The parent context will NOT be None here (an object is ALWAYS - # contained in a context). - parent = node.context - - return len(text.strip()) > 0 and text not in parent.list_names("") - - def set_text(self, node, text): - """ Sets the label text for a node. """ - - node.context.rename(node.name, text) - node.name = text - - return diff --git a/docs/releases/upcoming/233.removal.rst b/docs/releases/upcoming/233.removal.rst new file mode 100644 index 000000000..89d0d8c48 --- /dev/null +++ b/docs/releases/upcoming/233.removal.rst @@ -0,0 +1 @@ +Remove ``apptools.naming.ui`` sub package (#233) \ No newline at end of file diff --git a/examples/naming/explorer.py b/examples/naming/explorer.py deleted file mode 100644 index 14b6b3251..000000000 --- a/examples/naming/explorer.py +++ /dev/null @@ -1,47 +0,0 @@ -#------------------------------------------------------------------------------ -# 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: Enthought, Inc. -# Description: -#------------------------------------------------------------------------------ -""" A naming system explorer. """ - -# Enthought library imports. -from apptools.naming.api import Binding -from apptools.naming.api import PyContext -from apptools.naming.ui.explorer import Explorer -from pyface.api import GUI -from traits.api import HasTraits, Instance, List, Str - - -class Foo(HasTraits): - name = Str() - names = List(Str()) - - -class Bar(HasTraits): - foo = Instance(Foo) - - -# Application entry point. -if __name__ == '__main__': - - # Create the GUI (this does NOT start the GUI event loop). - gui = GUI() - - # Create the root context. - root = PyContext(namespace=Bar(foo=Foo(name="Hello", names=["1", "2"]))) - - # Create and open the main window. - window = Explorer(root=Binding(name='Root', obj=root)) - window.open() - - # Start the GUI event loop. - gui.start_event_loop() diff --git a/image_LICENSE.txt b/image_LICENSE.txt index 54a66ddd7..8dbf5c87f 100644 --- a/image_LICENSE.txt +++ b/image_LICENSE.txt @@ -3,19 +3,9 @@ licensed accordingly to the original license: Project License File ---------------------------------------------------------------------------- -GV: Gael Varoquaux BSD-like LICENSE.txt Enthought BSD-like LICENSE.txt Nuvola LGPL image_LICENSE_Nuvola.txt OOo LGPL image_LICENSE_OOo.txt Unless stated in this file, icons are work of Enthought, and are released under BSD-like license. -Files and original authors: ----------------------------------------------------------------- -apptools/help: - help_action.png | GV - -apptools/naming/ui/images (and examples/naming/images): - closed_folder.png | GV - document.png | GV - open_folder.png | GV diff --git a/setup.py b/setup.py index e9958dd65..0893c58cc 100644 --- a/setup.py +++ b/setup.py @@ -299,7 +299,6 @@ def get_long_description(): 'apptools': [ 'logger/plugin/*.ini', 'logger/plugin/view/images/*.png', - 'naming/ui/images/*.png', 'preferences/tests/*.ini' ] },