GithubHelp home page GithubHelp logo

Comments (2)

parkouss avatar parkouss commented on September 2, 2024

Hum, since ewmh 0.1.5, we use the xlib package provided on pypi (it was basically a fix for python2):

308d4d7

It looks like you are using python3, and we changed the dependency from python3-xlib to python-xlib. Maybe this is the issue? I did a quick test and it looked fine, but I am not sure the packages really are the same. Could you could try to change the dependency to python3-xlib, and tell me if that help?

from pyewmh.

Aufschlauer avatar Aufschlauer commented on September 2, 2024

Well, between ewmh 0.1.4 and 0.1.5 there is at least a change in return value: When you call

self.ewmh.getWmName(l_window)

you get with 0.1.4 a string like

"Window name"

but since ewmh 0.1.5 you get literals:

b'Window name'

both running python3 and values taken from eclipse debugger. But true, this is easily fixable on my side.

But the Xlib.error.ConnectionClosedError remains when I set the install_requires to python3-xlib:

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup
import sys, re

if sys.version_info < (2, 6):
    sys.exit("ewmh >= 0.1.3 requires python >= 2.6")

setup(name='ewmh',
      version=re.findall("__version__ = '(.+)'", open('ewmh/__init__.py').read())[0],
      description='python implementation of Extended Window Manager Hints, based on Xlib',
      long_description=open('README.rst').read(),
      author='parkouss',
      author_email="[email protected]",
      url='https://github.com/parkouss/pyewmh',
      packages=['ewmh'],
      install_requires=['python3-xlib'],
      license='LGPL',
      classifiers=(
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 3',
          'Intended Audience :: Developers',
      ),
)

Build and installation looks like this:

vagrant@vagrant-ubuntu-saucy-64:/tmp/ewmh-0.1.5$ sudo python3 setup.py install
running install
Checking .pth file support in /usr/local/lib/python3.3/dist-packages/
/usr/bin/python3 -E -c pass
TEST PASSED: /usr/local/lib/python3.3/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing dependency_links to ewmh.egg-info/dependency_links.txt
writing ewmh.egg-info/PKG-INFO
writing requirements to ewmh.egg-info/requires.txt
writing top-level names to ewmh.egg-info/top_level.txt
reading manifest file 'ewmh.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'doc/_build'
writing manifest file 'ewmh.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/ewmh
copying ewmh/ewmh.py -> build/lib/ewmh
copying ewmh/__init__.py -> build/lib/ewmh
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/ewmh
copying build/lib/ewmh/ewmh.py -> build/bdist.linux-x86_64/egg/ewmh
copying build/lib/ewmh/__init__.py -> build/bdist.linux-x86_64/egg/ewmh
byte-compiling build/bdist.linux-x86_64/egg/ewmh/ewmh.py to ewmh.cpython-33.pyc
byte-compiling build/bdist.linux-x86_64/egg/ewmh/__init__.py to __init__.cpython-33.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying ewmh.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying ewmh.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying ewmh.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying ewmh.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying ewmh.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/ewmh-0.1.5-py3.3.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing ewmh-0.1.5-py3.3.egg
creating /usr/local/lib/python3.3/dist-packages/ewmh-0.1.5-py3.3.egg
Extracting ewmh-0.1.5-py3.3.egg to /usr/local/lib/python3.3/dist-packages
Adding ewmh 0.1.5 to easy-install.pth file

Installed /usr/local/lib/python3.3/dist-packages/ewmh-0.1.5-py3.3.egg
Processing dependencies for ewmh==0.1.5
Searching for python3-xlib==0.15
Best match: python3-xlib 0.15
Adding python3-xlib 0.15 to easy-install.pth file

Using /usr/local/lib/python3.3/dist-packages
Finished processing dependencies for ewmh==0.1.5

Trying to get an instance still looks like this:

vagrant@vagrant-ubuntu-saucy-64:/tmp/ewmh-0.1.5$ python3
Python 3.3.2+ (default, Feb 28 2014, 00:52:16) 
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ewmh
>>> l_ewmh = ewmh.EWMH()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./ewmh/ewmh.py", line 50, in __init__
    self.display = _display or display.Display()
  File "/usr/local/lib/python3.3/dist-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
  File "/usr/local/lib/python3.3/dist-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/usr/local/lib/python3.3/dist-packages/Xlib/protocol/display.py", line 132, in __init__
    auth_prot_data = auth_data)
  File "/usr/local/lib/python3.3/dist-packages/Xlib/protocol/display.py", line 1033, in __init__
    display.send_and_recv(request = -1)
  File "/usr/local/lib/python3.3/dist-packages/Xlib/protocol/display.py", line 573, in send_and_recv
    raise self.socket_error
Xlib.error.ConnectionClosedError: Display connection closed by server
>>> 

When I install ewmh like ${PIP3_PATH}/pip3 install ewmh==0.1.4 everything is fine again. So there must be a change somewhere... ;-)

from pyewmh.

Related Issues (14)

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.