Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbx_preference fails due to circular dependency #87

Closed
spell02 opened this issue Dec 3, 2018 · 1 comment
Closed

dbx_preference fails due to circular dependency #87

spell02 opened this issue Dec 3, 2018 · 1 comment

Comments

@spell02
Copy link

spell02 commented Dec 3, 2018

dbx_preference fails to open with the following error:

Traceback (most recent call last):
  File "/usr/bin/dbx_preference", line 31, in <module>
    from dockbarx.common import *
  File "/usr/local/lib/python2.7/dist-packages/dockbarx/common.py", line 32, in <module>
    from log import logger
  File "/usr/local/lib/python2.7/dist-packages/dockbarx/log.py", line 27, in <module>
    from common import get_app_homedir
ImportError: cannot import name get_app_homedir

This is because dockbarx/common.py imports dockbarx/log.py, which imports dockbarx/common.py for get_app_home_dir().

On a different note, in get_app_home_dir(), the home directory is gotten with os.environ['HOME'] but I believe that expanduser("~") is more portable. Don't quote me on this, but just an aside.

@denisfa
Copy link
Contributor

denisfa commented Dec 4, 2018

Hey! Sorry for that, such a bad mistake for my part. =(

About being more portable, do you mean between Linux' OSes? I know there are better ways to get the home dir when you want you app to run Windows/MacOS/Linux but, at least for now, this is a Linux-only app.

HOME=/tmp python2.7
>>> import os
>>> os.path.expanduser("~")
'/tmp'

I checked if we could avoid trolling with this, but seems to be the same.

M7S pushed a commit that referenced this issue Jan 3, 2019
@M7S M7S closed this as completed Jan 3, 2019
M7S pushed a commit that referenced this issue Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants