pazz / urwidtrees Goto Github PK
View Code? Open in Web Editor NEWtree widgets for urwid
License: GNU General Public License v3.0
tree widgets for urwid
License: GNU General Public License v3.0
Should probably remove:
docs/examples/example1.pyc
docs/examples/__pycache__/
Add a .gitignore
with https://github.com/github/gitignore/blob/master/Python.gitignore or at least *.pyc
.
Hey there,
thank you for this amazing project.
For the distro packaging work like (https://bugs.gentoo.org/929519), it would nice if you could clarify,
which python version you support.
Thank you !
This will make it easier for potential users of the package to work out what it does and what it's capable of.
Hej everybody,
I'm looking for a way to dynamically change a tree (update/delete items), is this currently possible? Reading the urwid docs, I found that such a class has to be derived from MonitoredList
but couldn't find anything here. Does anybody have an idea how to start?
Hey, sorry for the question but I've been going through the examples today and I can't find a way to change the code so the root of the tree will be the current working directory. Is this possible to do?
The correct key name that is picked up by pip
in setup.py
is install_requires
:
https://github.com/pazz/urwidtrees/blob/master/setup.py#L15
Trying to install urwidtrees
without having urwid
installed results in:
> $ pip install urwidtrees [±master ●]
Collecting urwidtrees
Using cached urwidtrees-1.0.1.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-VGDG1V/urwidtrees/setup.py", line 4, in <module>
import urwidtrees.version as v
File "urwidtrees/__init__.py", line 6, in <module>
from .decoration import DecoratedTree, CollapsibleTree
File "urwidtrees/decoration.py", line 4, in <module>
import urwid
ImportError: No module named urwid
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-VGDG1V/urwidtrees/
It would be nice to have urwidtrees
in pypi. If you find it a hassle, I can maintain it for you.
Looking at PyPI I can see there is a 1.0.1.1
release while on github there is just 1.0. Would it be possible to have those in a sync?
It looks like mock is only used for the docs, so I would suggest removing it from install_requires.
Also, since it is included as unittest.mock in Python 3.3+, I would suggest using 'mock;python_version<"3.3"'
to only pull it when needed. Commit 76a79ae already provides support for it.
$ virtualenv-2.7 test
New python executable in test/bin/python
Installing setuptools, pip, wheel...done.
$ source test/bin/activate
(test) $ pip install urwidtrees
You are using pip version 7.0.3, however version 7.1.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting urwidtrees
Downloading urwidtrees-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/private/var/folders/pm/10pl16cj2mldkky06201p_7w0000gn/T/pip-build-pMpY4h/urwidtrees/setup.py", line 4, in <module>
import urwidtrees
File "urwidtrees/__init__.py", line 11, in <module>
from .decoration import DecoratedTree, CollapsibleTree
File "urwidtrees/decoration.py", line 4, in <module>
import urwid
ImportError: No module named urwid
I am working on a fix.
I'm trying to package urwidtrees to Fedora and just realized that license is not available. Would it be possible to add it? Can provide patch.
I'm attempting to dynamically remove nodes from a custom Tree. This gist contains a boiled down example of what I'm trying to do, but it does not work; the data is removed but the program exits with a "TypeError: 'NoneType' object is not iterable" exception. What am I doing wrong?
How do I add/rename/delete tree nodes while the widget is live?
I understand how to build the initial structure from your examples, I am creating a SimpleTree and adding it to a CollapsibleArrowTree, everything is working fine, i can save and reload the tree from an XML file
but while the Tree is running, what is the correct way to add a new child, or delete a child from the tree?
I have been studying this API for several days I and I feel like I'm missing something very basic here.
My first method was to do it the way I initially built the tree, but manually stepping thru SimpleTree._treelist and making the changes.
My second method was to make the changes in the XML, rebuild the tree from scratch and reassign the SimpleTree to the CollapsibleArrow tree during runtime.
both attempts I was able to create a child node where I wanted to, and I could delete a node if it had a sibling beneath it, otherwise i get "TypeError: 'NoneType' object is not subscriptable" on urwidtrees/tree.py line 192
i'm sorry to bother you with this novice question but i would appreciate any advice
thank you
Currently +
and -
are used to expand/collapse. Those aren't the intuitive keys. I'd suggest to support space and/or enter if tree element is focused.
If you have example0.py and replace None
by replaced by []
or ()
it doesn't work properly.
Try moving cursor down after replacing None
by []
and it'll hide lines. Other strange behaviors happen with the CollapsibleIndentedTree
and []
.
That probably means replacing some if XXX is not None:
by if not XXX:
(which is usually better anyway) in tree.py and possibly elsewhere.
May do, but should make it official:
pip install git+https://github.com/pazz/urwidtrees.git
travis can be used to automatically push a new release to pypi for each new git tag.
https://docs.travis-ci.com/user/deployment/pypi/
I think the best way would be to get access to the pypi account, otherwise the pypi guys need to be contacted to transfer the repository. This needs to be done anyway if the current maintainer uses the account for other packages, too.
Also for maintainability reasons, maybe more than one active collaborator should have access to the pypi account?
In 4c0e887 the line import urwidtrees
was (re-)added to setup.py.
Now python setup.py install
imports urwid before installing it as a dependency and raises ImportError: No module named urwid
.
This was fixed in #29 where other things got broken. Sorry for that!
I can create a PR, just thought some clarification and opinions first ;)
A recommended approach is to place the version in a separate file. E.g. urwidtrees/version.py:
__version__ = '1.0.2'
Then read and execute it in setup.py:
with open('urwidtrees/version.py') as f:
exec(f.read())
setup(
version=__version__,
and import it in urwidtrees/__init__.py to get urwidtrees.__version__
:
from .version import __version__, __version_info__
Further reading: http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
The version.py (maybe meta_info.py?) could also contain __author__
, __description__
, etc. to have it all in a single place and inside the module.
Hi @pazz,
I'm running the testing branch of alot which require urwidtrees version 1.0.
This is tagged to be 1.0 but in __init__.py
version is still 0.1, breaking manual installation.
Could you fix that? Should I send a PR for such a small thing?
cheers
In trying the demos the up and down keys walked into every child, I couldn't figure out (as a dumb user) how to jump to the next sibling, which is what i feel like up and down should do instead of walking to the next child. Is that configurable? (i didn't see it in my rushed view of the examples/docs)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.