So, I am on th <https://docs.python.org/3/tutorial/modules.html>
and try to figure out, whats going wrong here.

Python search its modules in "sys.path" which can be modified by an
application and this mean, the modification is wrong, because it can
not find the module "blueman" in with the path
"/usr/lib/python3.5/site-packages/blueman"


>Am 2018-01-29 hackte Michelle Konzack in die Tasten:
> # support running uninstalled
> _dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))

If I am right, __file__ is /usr/bin/blueman-applet and os.path.dirname
accordenly /usr/bin and since it has the ".." in the command, I assume
this mean one directory back => /usr

> if 'BLUEMAN_SOURCE' in os.environ:
>     sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] +
> sys.path

So here this line want to join the original sys.path with the previously
gotten _dirname (/usr) with something prefixed

In os.py is written:

----8<------------------------------------------------------------------
To get a full path (which begins with top) to a file or directory in
dirpath, do os.path.join(dirpath, name).
----8<------------------------------------------------------------------

In our case, we have

    os.path.join(_dirname, 'module', '.libs')

which is then wrong, because os.path.join has only two parameters.

>     os.environ["GSETTINGS_SCHEMA_DIR"] = os.path.join(_dirname, "data")

and here it is right.

So, this mean, we have to get this line

sys.path = [_dirname, os.path.join(_dirname, 'module', '.libs')] + sys.path

right, but I do not understand the construnct in the [ ... ]

I do not find the resource on the python website because I do not know,
for what I have to search for.

Maybe I subscribe to a Python Mailinglist...  ;-)
It seems, I have to start learning Python now.

Thanks in avance

-- 
Michelle Konzack        Miila ITSystems @ TDnet
GNU/Linux Developer     00372-54541400

Reply via email to