weechat-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Weechat-dev] [bug #18101] add ~/.weechat/python/ to PYTHONPATH for scri


From: ts
Subject: [Weechat-dev] [bug #18101] add ~/.weechat/python/ to PYTHONPATH for script loading
Date: Tue, 24 Oct 2006 20:18:12 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux; ppc; en_US) KHTML/3.5.2 (like Gecko)

URL:
  <http://savannah.nongnu.org/bugs/?18101>

                 Summary: add ~/.weechat/python/ to PYTHONPATH for script
loading
                 Project: Wee Enhanced Environment for Chat
            Submitted by: timotheus25
            Submitted on: Tuesday 10/24/2006 at 20:18
                Category: plugins
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open

    _______________________________________________________

Details:

Hi. Python scripts loaded by WeeChat need the ability to 'import' scripts
from non-global locations within their home directory, especially when the
imported scripts are not weechat scripts themselves (but rather libraries,
data structures, whatever...)

A good place would be:
${HOME}/.weechat/python/

So, the python interpreter might do one of:

(1) before running python, something that is effective to
# export PYTHONPATH=${HOME}/.weechat/python:${PYTHONPATH}

(2) evaluate this code before load of each script:
import sys, os
sys.path.insert(0, os.environ['HOME'] + '/.weechat/python')

(3) provide an API function that effectively does (2) for the script,
whenever such behavior applies for that language.







    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?18101>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]