[CF-Devel] Re: [Crossfire-cvs] CVS commit: maps-bigworld/python/events

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Thu Oct 21 15:23:04 CDT 2004


I think that you want to insert the python map path into second place in 
the sys.path list - the first(zeroth) place is '' and if this is not the 
first item in the list I think python won't look in the local directory 
for modules first.  I think we want to have default behaviour where it 
looks in the current dir for modules first and only insert our path 
before the installed python lib paths so we should change the script to 
read:

sys.path.insert(1, os.path.join(CFPython.GetDataDirectory(), CFPython.GetMapDirectory(), 'python'))

>
     
     Module Name:	maps-bigworld
     
     >
     
     Committed By:	akirschbaum
     
     >
     
     Date:		Thu Oct 21 18:57:43 UTC 2004
     
     >
     
     
     >
     
     Added Files:
     
     >
     
     	maps-bigworld/python/events: python_init.py
     
     >
     
     
     >
     
     Log Message:
     
     >
     
     Add script for bootstrapping code. The script runs right after the python plugin is loaded.
     
     >
     
     
     >
     
     
     >
     
     
     >
     
     Start of context diffs
     
     >
     
     
     >
     
     
     >
     
     Index: maps-bigworld/python/events/python_init.py
     
     >
     
     diff -c /dev/null maps-bigworld/python/events/python_init.py:1.1
     
     >
     
     *** /dev/null	Thu Oct 21 11:57:43 2004
     
     >
     
     --- maps-bigworld/python/events/python_init.py	Thu Oct 21 11:57:42 2004
     
     >
     
     ***************
     
     >
     
     *** 0 ****
     
     >
     
     --- 1,5 ----
     
     >
     
     + import CFPython;
     
     >
     
     + import os.path
     
     >
     
     + import sys
     
     >
     
     + 
     
     >
     
     + sys.path.insert(0, os.path.join(CFPython.GetDataDirectory(), CFPython.GetMapDirectory(), 'python'))
     
     >
     
     
     >
     
     
     >
     
     
     >
     
     
     

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list