Git Product home page Git Product logo

i3-py's People

Contributors

endreszabo avatar jvd avatar ziberna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

i3-py's Issues

window event

I'd like to listen to window events

i3.subscribe('window', 'new', lambda: print('new window'))

but I get

i3.EventTypeError: Event type 'window' isn't available

Please add support for window events.

Split the repo into i3-py and i3-py-examples

Hi, I suggest splitting the repo into two, i3-py, which has the library code in it, and i3-py-examples for the examples. Pip only installes the library, which is fine. Most people will want their custom scripts using it in something like ~/.config/i3/contrib or so, so it would be great if they could just clone the example repo into that folder.

UnicodeDecodeError on workspace event

When running a simple python3 test, using:
def my_function(event, data, subscription):
...
subscription = i3.Subscription(my_function, 'workspace')

Then the event thread crashes when visiting (mod-<1..0>) certain invisible workspaces. Not all invisible workspaces cause a crash:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.3/threading.py", line 637, in _bootstrap_inner
self.run()
File "/usr/lib/python3.3/site-packages/i3.py", line 324, in run
self.listen()
File "/usr/lib/python3.3/site-packages/i3.py", line 338, in listen
event = self.event_socket.receive()
File "/usr/lib/python3.3/site-packages/i3.py", line 218, in receive
return self.unpack(data)
File "/usr/lib/python3.3/site-packages/i3.py", line 248, in unpack
payload = data[self.struct_header_size:msg_size].decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 992: invalid start byte

broken native python doc abilities

i3 module is not able to support traditional ways of accessing documentation and exploring the module.

For example, pydoc i3 gives this traceback:

Traceback (most recent call last):
  File "/usr/bin/pydoc", line 5, in <module>
    pydoc.cli()
  File "/usr/lib64/python2.7/pydoc.py", line 2361, in cli
    help.help(arg)
  File "/usr/lib64/python2.7/pydoc.py", line 1829, in help
    elif request: doc(request, 'Help on %s:')
  File "/usr/lib64/python2.7/pydoc.py", line 1568, in doc
    pager(render_doc(thing, title, forceload))
  File "/usr/lib64/python2.7/pydoc.py", line 1563, in render_doc
    return title % desc + '\n\n' + text.document(object, name)
  File "/usr/lib64/python2.7/pydoc.py", line 357, in document
    if inspect.ismodule(object): return self.docmodule(*args)
  File "/usr/lib64/python2.7/pydoc.py", line 1111, in docmodule
    for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
  File "/usr/lib64/python2.7/pkgutil.py", line 143, in iter_modules
    importers = map(get_importer, path)
TypeError: argument 2 to map() must support iteration

Also, the module object cannot iterate its members:

$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18) 
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import i3
>>> dir(i3)
['__module__', '__name__']
>>> 

which has also the effect that tab completion does not work in smart python shells like IPython.

I think this is caused by the fact that the module object is somehow assembled on the fly but does not support all necessary methods.

(I may be looking into this and come up with more specifics or even a PR ... if I have time, which I can't promise now :/)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.