diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-11 08:46:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-11 08:46:20 +0000 |
commit | 60b8ecaf2afb874b733c1c61be26da68df51d989 (patch) | |
tree | 8888727f276e44d23fc64b6b285dc00150a7a466 /treelib/__init__.py | |
parent | Initial commit. (diff) | |
download | treelib-upstream/1.6.4.tar.xz treelib-upstream/1.6.4.zip |
Adding upstream version 1.6.4.upstream/1.6.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'treelib/__init__.py')
-rw-r--r-- | treelib/__init__.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/treelib/__init__.py b/treelib/__init__.py new file mode 100644 index 0000000..4902412 --- /dev/null +++ b/treelib/__init__.py @@ -0,0 +1,39 @@ +# Copyright (C) 2011 +# Brett Alistair Kromkamp - brettkromkamp@gmail.com +# Copyright (C) 2012-2017 +# Xiaming Chen - chenxm35@gmail.com +# and other contributors. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +treelib - Python 2/3 Tree Implementation + +`treelib` is a Python module with two primary classes: Node and Tree. +Tree is a self-contained structure with some nodes and connected by branches. +A tree owns merely a root, while a node (except root) has some children and one parent. + +Note: To solve string compatibility between Python 2.x and 3.x, treelib follows +the way of porting Python 3.x to 2/3. That means, all strings are manipulated as +unicode and you do not need u'' prefix anymore. The impacted functions include `str()`, +`show()` and `save2file()` routines. +But if your data contains non-ascii characters and Python 2.x is used, +you have to trigger the compatibility by declaring `unicode_literals` in the code: + +.. code-block:: python + + >>> from __future__ import unicode_literals +""" + +from .tree import Tree # noqa: F401 +from .node import Node # noqa: F401 |