On Sat, Feb 12, 2011 at 6:57 PM, Aleksey Lim
<alsr...@activitycentral.org> wrote:
> The problem is, if I got it right, that cwd means nothing for searching
> modules, only sys.path(and so) makes sense. After launching Python
> interpreter, the $0 becomes sys.path[0]. But the problem is that
> activities start from sugar-activity command, thus sys.path[0] is
> /usr/bin/. So, there is need in adding SUGAR_BUNDLE_PATH to the sys.path
> manually (ie simulate Python interpreter behaviour). But existed code
> does it wrong (add to the end of sys.path).

OK - so when starting pure Python activities, the shell is never
involved, and we just fork the python interpreter.

In that case, yes, it makes sense to put SUGAR_BUNDLE_PATH in
sys.path[0]. It mimics what Python would normally do.



m
-- 
 martin.langh...@gmail.com
 mar...@laptop.org -- Software Architect - OLPC
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
_______________________________________________
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel

Reply via email to